
(function() {
    //NCOMCONSTANTDYNAMICDOMAIN
    var __NCOM_CONSTANT_DYNAMIC_DOMAIN = 'content.samsung.com';
    //NCOMCONSTANTSTATICURLROOT
    var __NCOM_CONSTANT_STATIC_URL_ROOT = 'http://img.content.samsung.com/static';
    //NCOMCONSTANTSTATICCOMMONURL
    var __NCOM_CONSTANT_STATIC_COMMON_URL = 'http://pub.content.samsung.com';

    var __mode = "prd"; //stg, qa, prd
    var __serverMode = "global"; //global,cn
    
    var tab_ModelID = Array("GT Wi-Fi 7_E", "GT-5200", "GT-N5120", "GT-N8000", "GT-N8005", "GT-N8010", "GT-N8013", "GT-N8020", "GT-N8100", "GT-P1000", "GT-P1000L", "GT-P1000M", "GT-P1000N", "GT-P1000R", "GT-P1000T", "GT-P1010", "GT-P31 00B", "GT-P3100", "GT-P3100B", "GT-P3105", "GT-P3110", "GT-P3113", "GT-P5100", "GT-P5110", "GT-P5113", "GT-P5120", "GT-P5200", "GT-P5210", "GT-P6200", "GT-P6200L", "GT-P6200T", "GT-P6201", "GT-P6210", "GT-P6210T", "GT-P6211", "GT-P6800", "GT-P6801", "GT-P6810", "GT-P6811", "GT-P7100", "GT-P7300", "GT-P7300B", "GT-P7310", "GT-P7320", "GT-P7320T", "GT-P7500", "GT-P7500M", "GT-P7500R", "GT-P7500V", "GT-P7501", "GT-P7503", "GT-P7510", "GT-P7511", "GT-P7560", "GT-P8110", "HQTEST_O121202", "new-tablet", "NTG_Wifi_WSVGA_E", "NTG_WSVGA_E", "SAMSUNG-SGH-I467", "SC-01C", "SC-01D", "SC-01E", "SC-02D", "SCH-I800", "SCH-I889", "SCH-I905", "SCH-I915", "SCH-P739", "SGH-I467", "SGH-I497", "SGH-I807", "SGH-I957", "SGH-I957D", "SGH-I957M", "SGH-I957R", "SGH-I987", "SGH-N015", "SGH-T849", "SGH-T859", "SGH-T869", "SHV-E140K", "SHV-E140L", "SHV-E140S", "SHV-E150S", "SHV-E230K", "SHV-E230L", "SHV-E230S", "SHW-M180K", "SHW-M180L", "SHW-M180S-SIS", "SHW-M180S_tab", "SHW-M180W", "SHW-M305W", "SHW-M380K", "SHW-M380L", "SHW-M380S", "SHW-M380W", "SHW-M430W", "SHW-M480K", "SHW-M480S", "SHW-M480W", "SHW-M485W", "SHW-M500W", "SM-P095", "SM-P600", "SM-P600X", "SM-P601", "SM-P605K", "SM-P605L", "SM-P605S", "SM-P900", "SM-P905", "SM-T110X", "SM-T111M", "SM-T210", "SM-T211", "SM-T215", "SM-T310", "SM-T311", "SM-T315", "SPH-P100", "SPH-P500", "SPH-P600", "Swingo_Test", "tab3", "TabletGX2Wifi_E", "TabletGX2_E", "TabletGX_E", "YP-GP1"); 
    
    var __NcomuiMessageBundleJson = {'v2_pc_etc2_t0001' : 'Đang tiến hành chuẩn bị dịch vụ.','v2_pc_ncomui_t0007' : 'Đăng xuất','v2_pc_ncomui_t0001' : 'Đăng nhập','v2_pc_ncomui_t0002' : 'Giới thiệu về chúng tôi','v2_pc_ncomui4_t0001' : 'Hỗ trợ khách hàng','v2_pc_ncomui_t0004' : 'Thông báo','v2_pc_ncomui_t0005' : 'Sự kiện','v2_pc_ncomui_t0006' : 'Samsung.com','v2_pc_ncomui_t0013' : 'Điều khoản & Điều kiện đi kèm','v2_pc_ncomui_t0014' : 'Thu thập và sử dụng thông tin cá nhân','v2_pc_ncomui_t0016' : 'Chính sách quản lý bảo mật','v2_pc_ncomui_t0017' : 'Chính xách xử lý bảo mật','v2_pc_ncomui_t0011' : 'Nguồn cấp tin tức','v2_pc_ncomui_t0008' : 'Sơ đồ trang web','v2_pc_ncomui_t0009' : 'Điều khoản & Điều kiện','v2_pc_ncomui_t0010' : 'Bảo mật','v5_main_C0401_t0058' : 'Sửa đổi','v4_pc_add_t0001' : '','v6_pc_profile_t0001' : 'Ngày sinh','v6_pc_profile_t0002' : 'Quốc gia','v6_pc_profile_t0003' : 'Sửa đổi','v2_pc_ncomui_t0025' : 'Samsung.com','pc_msg_C0401_t0002' : 'Xem phiên bản dành cho thiết bị di động','pc_msg_C0401_t0003' : 'Trang này được tối ưu hóa để xem trên thiết bị di động. Truy cập phiên bản dành cho thiết bị di động?','v6_pc_idea_t0001' : 'Đề xuất','v6_pc_idea_t0007' : 'Bạn phải đăng nhập để sử dụng dịch vụ này. Bạn có muốn đăng nhập?','front_msg_C0401_t013' : 'Tìm di động của bạn','v5_apps_C0401_t0001' : 'Samsung Apps','v5_main_C0401_t0024' : 'Samsung Link','v6_pc_main_gnb_t0001' : 'Chi tiết','v6_tv_aboutn_main_t0002' : 'Nội dung & Dịch vụ','v6_pc_main_profile_t0004' : '','v2_dev_add_photo_t0001' : 'Close','v6_web_t0002' : '','v6_web_t0010' : '','v6_web_t0011' : '','v6_web_t0012' : '','v6_web_t0015' : '','v6_web_t0016' : '','v6_web_t0018' : '','v6_web_t0021' : '','v2_pc_evt_t0003' : 'Sự kiện mới','v2_pc_common_t0003' : 'Mới'};

    // 번들 메시지 예외 처리.
    var __messageBundleExcept = {
            "GB" : {
                "v2_pc_ncomui_t0011" : "Samsung Social",
                "v2_pc_ncomui_t0004" : "Latest News",
                "v5_main_C0401_t0058" : "Edit",
                "v6_pc_profile_t0003" :  "Edit"
            },
            "DE" : {
                "front_msg_C0401_t013" : "Find My Mobile"
            }
    };
    
    var footerWebsitecreditsNationCode = "AT,BE,BG,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,NL,PL,PT,RO,SK,SI,ES,SE,GB,CY,MT";
    var headerAdditionalLogoNationLocale = {'AR':'es_ar', 'AT':'de_at'};
   
    var __isMobile = false;
    var __isTab = false;
    var __isRedirect = false;
    var __fullBrowser;
    var __deviceTypeConst = {
        PC : Number(0),
        MOBILE : Number(1),
        TAB : Number(2),
        TV : Number(3)
    };
    var deviceType = __deviceTypeConst.PC;
    var mobileKeyWords = new Array('iPhone', 'iPod', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson');
    var mobileHomeUrl = "";
    var __mobileLinkUrl = {
            "prd" : {
                "allshareplay" : "http://link.samsung.com",
                "chaton" : "http://chaton.samsung.com"
            },
            "qa" : {
                "allshareplay" : "http://link.samsung.com/",
                "chaton" : "http://value.samsungchaton.com/"
            },
            "stg" : {
                "allshareplay" : "http://link.samsung.com",
                "chaton" : "http://stg.web.samsungchaton.com"
            }
    };
    
    var ncomuiUrlNationCode = "";
    
    function isMobile() {
        var arrLen = mobileKeyWords.length;
        for (var i =0; i< arrLen ; i++){
            if (navigator.userAgent.match(mobileKeyWords[i]) != null){
                return true;
            }
        }
        return false;
    };

    function isTab() {
        var arrLen1 = tab_ModelID.length;
        for (var i=0; i< arrLen1; i++){
            if (navigator.userAgent.match(tab_ModelID[i]) != null){
                return true;
            }
        }
        return false;
    };

    function isRedirect() {
        if (document.location.href.match("redirect") != null){
            return true;
        }
        return false;
    };
    
    function redirectException() {
    
        if(__isRedirect == false) {
            if(ncomui.getServiceCode() == 'findmymobile' 
                || ncomui.getServiceCode() == 'support' || ncomui.getServiceCode() == 'support2' 
                || ncomui.getServiceCode() == 'ncom' || ncomui.getServiceCode() == 'apps' || ncomui.getServiceCode() == 'tvapps'){
                // redirect 안 함
            }else if(location.href.indexOf("_full_browser_confirm=Y") > -1){
                if(confirm(getNcomuiMessageBundleValue("pc_msg_C0401_t0003"))){
                    ncomui.setCookie('_full_browser', 'N', 1);
                    document.location.href = mobileHomeUrl;
                    return;
                }else{
                    ncomui.setCookie('_full_browser', 'Y', 1);
                    document.location.href = document.location.href + "&redirect";
                    return;
                }
            }else if((ncomui.getServiceCode() == 'chaton' || ncomui.getServiceCode() == 'allshareplay') && __fullBrowser == "Y" && ncomui.getCookie("_onlyOne") == ""){
                if(confirm(getNcomuiMessageBundleValue("pc_msg_C0401_t0003"))){
                    ncomui.setCookie('_full_browser', 'N', 1);
                    ncomui.setCookie('_onlyOne','Y',1);
                    if(ncomui.getServiceCode() == 'chaton'){
                        document.location.href = __mobileLinkUrl[__mode][ncomui.getServiceCode()];
                    }else if(ncomui.getServiceCode() == 'allshareplay'){
                        document.location.href = "http://" + __NCOM_CONSTANT_DYNAMIC_DOMAIN + "/mobile/" + ncomuiUrlNationCode + "/contents/aboutn/samsungLinkIntro.do?redirect";
                    }
                    return;
                }
            }else{
                if(ncomui.getServiceCode() != 'chaton' && ncomui.getServiceCode() != 'allshareplay' && (__isMobile || __isTab)) {
                    if(typeof __NCOM_CONSTANT_DYNAMIC_DOMAIN != "undefined") {
                        document.location.href = "http://" + __NCOM_CONSTANT_DYNAMIC_DOMAIN + "/mobile/" + ncomuiUrlNationCode + "/contents/aboutn/aboutnIntro.do?redirect";
                    } else {
                        document.location.href = "/mobile/" + ncomuiUrlNationCode + "/contents/aboutn/aboutnIntro.do?redirect";
                    }
                    return;
                }
            }
        }
    }
    
    function getNcomuiMessageBundleValue(key, param){ 
        var value;
        try{
            value = __messageBundleExcept[ncomui.getCountry()][key];
        } catch(e){
            value = "";
        }
        
        if(typeof value == "undefined" || value == ""){
            value = __NcomuiMessageBundleJson[key];  
        }
        
        if(key && key != ""){ 
            if(!value){return "N/K";} 
            if(param && param.length){ 
                for(each in param){ 
                    var regExp = eval("/\\{"+each+"\\}/g"); 
                    value=value.replace(regExp, param[each]);  
                } 
            } 
        } else { 
            value = ""; 
        } 
        return value; 
    }  
    
    __isMobile = isMobile();
    __isTab = isTab();
    __isRedirect = isRedirect();
    
    if (window.ncomui) return;  

    var ncomui = (function(){
        function __clsEvent() {
            this.type;
            this.countryCode;
            this.languageCode;
            this.stop = false;
            
            this.stopPropagation = function() {
                this.stop = true;
            };
        };

        var __initEnv = false;
        var __serviceCode = "ncom";
        var __serviceCodeClass = "";
        var __menuSelectClass = "";
        var __country = "";
        var __language = "vi";
        var __userAccount = "";
        var __eventListener = null;
        var __headerId = "";
        var __me = null;
        var __serviceId = "";
        var __languageSelectType = 0; //국가/언어 선택이 하나인것 0, 선택 따로 두개 인것 1;
        var __languageSelectType0SeviceCode = ["ncom"];
        var __primaryDomain = "samsung.com";
        var __primaryUrl = "dev.content.samsung.com";
        
        if(__primaryDomain == "samsung.cn" && __serverMode == "global"){    //개발서버용 소스
            __serverMode = "cn";
        }
        
        if(typeof __NCOM_CONSTANT_DYNAMIC_DOMAIN != "undefined") {
            __primaryUrl = __NCOM_CONSTANT_DYNAMIC_DOMAIN;
        }
        
        var __primaryStaticUrl = "http://dev.img.content.samsung.com/static";
        if(typeof __NCOM_CONSTANT_STATIC_URL_ROOT != "undefined") {
            __primaryStaticUrl = __NCOM_CONSTANT_STATIC_URL_ROOT;
            __primaryStaticUrl = __primaryStaticUrl.replace("http://","");
        }
        
        var __primaryStaticCommonUrl = "http://stg.pub.content.samsung.com";
        if(typeof __NCOM_CONSTANT_STATIC_COMMON_URL != "undefined") {
            __primaryStaticCommonUrl = __NCOM_CONSTANT_STATIC_COMMON_URL;
            __primaryStaticCommonUrl = __primaryStaticCommonUrl.replace("http://",window.location.protocol + "//");
        }
        
        var __countryCodesEnglish = {                
                "AT" : "Austria",
                "BE" : "Belgium",
                "BA" : "Bosnia and Herzegovina",
                "CY" : "Cyprus",
                "CZ" : "Czech",
                "DK" : "Denmark",
                "EE" : "Estonia",
                "FI" : "Finland",
                "FR" : "France",
                "DE" : "Germany",
                "GR" : "Greece",
                "HU" : "Hungary",
                "IS" : "Iceland",
                "IE" : "Ireland",
                "IT" : "Italy",
                "LV" : "Latvia",
                "LT" : "Lithuania",
                "LU" : "Luxembourg",
                "MK" : "FYROM",
                "MT" : "Malta",
                "ME" : "Montenegro",
                "NL" : "Netherlands",
                "NO" : "Norway",
                "PL" : "Poland",
                "PT" : "Portugal",
                "RO" : "Romania",
                "RS" : "Serbia",
                "SK" : "Slovakia",
                "SI" : "Slovenia",
                "ES" : "Spain",
                "SE" : "Sweden",
                "CH" : "Switzerland",
                "TR" : "Turkey",
                "GB" : "United Kingdom",
                "AM" : "Armenia",
                "AZ" : "Azerbaijani Republic",
                "BY" : "Belarus",
                "GE" : "Georgia",
                "KZ" : "Kazakhstan",
                "MD" : "Moldova, Republic of",
                "RU" : "Russia",
                "UA" : "Ukraine",
                "UZ" : "Uzbekistan",
                "AU" : "Australia",
                "BD" : "Bangladesh",
                "KH" : "Cambodia",
                "CN" : "China",
                "HK" : "Hong Kong",
                "IN" : "India",
                "ID" : "Indonesia",
                "JP" : "Japan",
                "KR" : "Korea",
                "MO" : "Macao",
                "MY" : "Malaysia",
                "MM" : "Myanmar",
                "NP" : "Nepal",
                "PH" : "Philippines",
                "SG" : "Singapore",
                "LK" : "Sri Lanka",
                "TW" : "Taiwan",
                "TH" : "Thailand",
                "VN" : "Vietnam",
                "AR" : "Argentina",
                "BR" : "Brazil",
                "CA" : "Canada",
                "CL" : "Chile",
                "CO" : "Colombia",
                "CR" : "Costa Rica",
                "DO" : "Dominican Republic",
                "EC" : "Ecuador",
                "SV" : "El Salvador",
                "GT" : "Guatemala",
                "HN" : "Honduras",
                "JM" : "Jamaica",
                "MX" : "Mexico",
                "NI" : "Nicaragua",
                "PA" : "Panama",
                "PY" : "Paraguay",
                "PE" : "Peru",
                "PR" : "Puerto Rico",
                "TT" : "Trinidad and Tobago",
                "US" : "USA",
                "UY" : "Uruguay",
                "VE" : "Venezuela",
                "DZ" : "Algeria",
                "AO" : "Angola",
                "BH" : "Bahrain",
                "BW" : "Botswana",
                "CM" : "Cameroon",
                "CG" : "Congo",
                "CD" : "DR Congo",
                "CI" : "Cote d'Ivoire",
                "EG" : "Egypt",
                "GH" : "Ghana",
                "IR" : "Iran, Islamic Republic of",
                "IQ" : "Iraq",
                "IL" : "Israel",
                "JO" : "Jordan",
                "KE" : "Kenya",
                "KW" : "Kuwait",
                "LB" : "Lebanon",
                "LY" : "Libya",
                "MU" : "Mauritius",
                "MA" : "Morocco",
                "MZ" : "Mozambique",
                "NA" : "Namibia",
                "NG" : "Nigeria",
                "OM" : "Oman",
                "PK" : "Pakistan",
                "QA" : "Qatar",
                "SA" : "Saudi Arabia",
                "SN" : "Senegal",
                "ZA" : "South Africa",
                "SD" : "Sudan",
                "SY" : "Syria",
                "TZ" : "Tanzania",
                "TN" : "Tunisia",
                "UG" : "Uganda",
                "AE" : "United Arab Emirates",
                "YE" : "Yemen",
                "NZ" : "New Zealand",
                "MN" : "Mongolia",
                "KG" : "Kyrgyzstan",
                "BG" : "Bulgaria",
                "HR" : "Croatia",
                "AL" : "Albania",
                "AF" : "Afghanistan",
                "LA" : "Laos",
                "TJ" : "Tajikistan",
                "TM" : "Turkmenistan",
                "BO" : "Bolivia",
                "ET" : "Ethiopia",
                "RW" : "Rwanda",
                "GA" : "Gabon",
                "CF" : "Central African Republic",
                "BI" : "Burundi",
                "SO" : "Somalia",
                "MG" : "Madagascar",
                "ZM" : "Zambia",
                "ZW" : "Zimbabwe",
                "SZ" : "Swaziland",
                "LS" : "Lesotho",
                "TG" : "Togo",
                "BJ" : "Benin",
                "LR" : "Liberia",
                "SL" : "Sierra Leone",
                "GN" : "Guinea",
                "10" : "Others"
        };
        
        //전체 서비스를 사용하지 않는 나라의 서비스코드를 선언한다.
        var __serviceCodes = {"10" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AF" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AU" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"AZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BD" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BI" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BJ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BW" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"BY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CD" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CF" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CI" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"CZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"DE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"DK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"DO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"DZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"EC" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"EE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"EG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ES" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ET" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"FI" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"FR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GB" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"GT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"HK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"HN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"HR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"HU" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ID" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IQ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IS" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"IT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"JM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"JO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"JP" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KW" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"KZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LB" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LS" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LU" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LV" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"LY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MD" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ME" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MU" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MX" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"MZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NI" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NP" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"NZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"OM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"PY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"QA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"RO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"RS" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"RU" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"RW" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SD" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SI" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SK" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SL" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SO" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SV" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"SZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TH" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TJ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TR" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TT" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TW" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"TZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"UA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"UG" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"US" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"UY" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"UZ" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"VE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"VN" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"YE" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ZA" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ZM" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""},
"ZW" : {"apps":"", "tvapps":"", "allshareplay":"", "findmymobile":"", "chaton":""}};

        var __languageCodesLocale = {
                "ar_ae" : "العربية",
                "bg" : "Български",
                "cs" : "čeština",
                "da" : "Dansk",
                "de" : "Deutsch",
                "el" : "Ελληνικά",
                "en_gb" : "English",
                "en_us" : "English",
                "es_es" : "Español",
                "es_latn" : "Español",
                "et" : "Estonian",
                "fa" : "فارسى",
                "fi" : "Suomi",
                "fr_ca" : "Français",
                "fr_fr" : "Français",
                "gd" : "Gaeilge",
                "he" : "עִבְרִית",
                "hr" : "Hrvatski",
                "hu" : "Magyar",
                "in" : "Indonesian",
                "is" : "Íslenska",
                "it" : "Italiano",
                "he" : "עִבְרִית",
                "ja" : "日本語",
                "kk" : "Қазақша",
                "ko" : "한국어",
                "lt" : "Lietuvių",
                "lv" : "Latviešu",
                "mk" : "македонски",
                "ms" : "Bahasa Melayu",
                "nl" : "Dutch",
                "no" : "Norsk",
                "pl" : "Polski",
                "pt_latn" : "Português",
                "pt_pt" : "Português",
                "ro" : "Română",
                "ru" : "Русский",
                "sk" : "Slovenčina", 
                "sr" : "Srpski",
                "sl" : "Slovenščina",
                "sq" : "Shqip",
                "st" : "Slovenščina",
                "sv" : "Svenska",
                "th" : "ภาษาไทย",
                "tr" : "Türkçe",
                "uk" : "Українська",
                "ur" : "اردو",
                "uz" : "U'zbek",
                "vi" : "tiếng Việt",
                "zh_cn" : "中文(简体)",
                "zh_hk" : "中文(香港)",
                "zh_tw" : "中文(繁體)",
                "id" : "Bahasa Indonesia",
                "nb" : "Norsk (bokmål)",
                "hi_in" : "हिन्दी",
                "en_af" : "English",
                "en_al" : "English",
                "en_la" : "English",                
                "en_tj" : "English",
                "en_tm" : "English"
        };
        
        var __linkUrl = {
                "prd" : {
                    "ncom" : "http://" + __primaryUrl,
                    "apps" : "http://apps.samsung.com",
                    "tvapps" : "http://tvapps.samsung.com",
                    "familystory" : "http://familystory.samsung.com",
                    "allshareplay" : "http://link.samsung.com",
                    "findmymobile" : "http://findmymobile.samsung.com",
                    "findmymobileinit" : "http://findmymobile.samsung.com/account/init.do",
                    "chaton" : "http://chaton.samsung.com"
                },
                "qa" : {
                    "ncom" : "http://" + __primaryUrl,
                    "apps" : "http://apps.samsung.com/",
                    "tvapps" : "http://tvapps.samsung.com/",
                    "familystory" : "http://stg-pcweb.familystory2.com/",
                    "allshareplay" : "http://link.samsung.com/",
                    "findmymobile" : "http://findmymobile.samsung.com",
                    "findmymobileinit" : "http://findmymobile.samsung.com/account/init.do",
                    "chaton" : "http://value.samsungchaton.com/"
                },
                "stg" : {
                    "ncom" : "http://" + __primaryUrl,
                    "apps" : "http://apps.samsung.com",
                    "tvapps" : "http://tvapps.samsung.com",
                    "familystory" : "http://familystory.samsung.com",
                    "allshareplay" : "http://link.samsung.com",
                    "findmymobile" : "http://findmymobile.samsung.com",
                    "findmymobileinit" : "http://findmymobile.samsung.com/account/init.do",
                    "chaton" : "http://stg.web.samsungchaton.com"
                }
        };
        
        var __secPath = {
                "AE" : {
                    "en" : "ae",
                    "ar" : "ae_ar"
                },
                "AR" : {
                    "es" : "ar"
                },
                "AT" : {
                    "de" : "at"
                },
                "AU" : {
                    "en" : "au"
                },
                "BE" : {
                    "nl" : "be",
                    "fr" : "be_fr"
                },
                "BG" : {
                    "bg" : "bg"
                },
                "BR" : {
                    "pt" : "br"
                },
                "CA" : {
                    "en" : "ca",
                    "fr" : "ca_fr"
                },
                "CH" : {
                    "de" : "ch",
                    "fr" : "ch_fr"
                },
                "CL" : {
                    "es" : "cl"
                },
                "CO" : {
                    "es" : "co"
                },
                "CZ" : {
                    "cs" : "cz"
                },
                "DE" : {
                    "de" : "de"
                },
                "DK" : {
                    "da" : "dk"
                },
                "EE" : {
                    "et" : "ee"
                },
                "EG" : {
                    "ar" : "eg"
                },
                "ES" : {
                    "es" : "es"
                },
                "FI" : {
                    "fi" : "fi"
                },
                "FR" : {
                    "fr" : "fr"
                },
                "GR" : {
                    "el" : "gr"
                },
                "HK" : {
                    "zh" : "hk",
                    "en" : "hk_en"
                },
                "HR" : {
                    "hr" : "hr"
                },
                "HU" : {
                    "hu" : "hu"
                },
                "ID" : {
                    "id" : "id"
                },
                "IE" : {
                    "en" : "ie"
                },
                "IL" : {
                    "he" : "il"
                },
                "IN" : {
                    "en" : "in"
                },
                "IR" : {
                    "fa" : "iran"
                },
                "IT" : {
                    "it" : "it"
                },
                "JP" : {
                    "ja" : "jp"
                },
                "KZ" : {
                    "ru" : "kz_ru"
                },
                "LT" : {
                    "lt" : "lt"
                },
                "LV" : {
                    "lv" : "lv"
                },
                "MX" : {
                    "es" : "mx"
                },
                "MY" : {
                    "en" : "my"
                },
                "NL" : {
                    "nl" : "nl"
                },
                "NO" : {
                    "no" : "no"
                },
                "NZ" : {
                    "en" : "nz"
                },
                "PE" : {
                    "es" : "pe"
                },
                "PH" : {
                    "en" : "ph"
                },
                "PK" : {
                    "en" : "pk"
                },
                "PL" : {
                    "pl" : "pl"
                },
                "PT" : {
                    "pt" : "pt"
                },
                "RO" : {
                    "ro" : "ro"
                },
                "RS" : {
                    "sr" : "rs"
                },
                "RU" : {
                    "ru" : "ru"
                },
                "SA" : {
                    "ar" : "sa"
                },
                "SE" : {
                    "sv" : "se"
                },
                "SG" : {
                    "en" : "sg"
                },
                "SI" : {
                    "sl" : "at/si"
                },
                "SK" : {
                    "sk" : "sk"
                },
                "TH" : {
                    "th" : "th"
                },
                "TR" : {
                    "tr" : "tr"
                },
                "TW" : {
                    "zh" : "tw"
                },
                "UA" : {
                    "uk" : "ua"
                },
                "GB" : {
                    "en" : "uk"
                },
                "US" : {
                    "en" : "us"
                },
                "VE" : {
                    "es" : "ve"
                },
                "VN" : {
                    "vi" : "vn"
                },
                "AF" : {
                    "en" : "pk"
                },
                "BO" : {
                    "es" : "bo"
                },
                "ET" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "RW" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "GA" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "CF" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "BI" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "SO" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "MG" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "ZM" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "ZW" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "SZ" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "LS" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "TG" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "BJ" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "LR" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "SL" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                },
                "GN" : {
                    "en" : "africa_en",
                    "fr" : "africa_fr"
                }
        };
        
        /*
        // 호출타입 : T -> ncomui_trackClicks, A-> ncomui_ajax_omnitureCall
        {
        "서비스명" : {
                    "메뉴명(혹은 CSS클래스명)" : "호출타입|클릭네임",
                   }
        */
        var __linkOmniture = {
                "ncom" : {
                    "ncom" : "",
                    "apps" : "A|__COUNTRY_CODE__:pc:gnb:mobileapps:main",
                    "tvapps" : "A|__COUNTRY_CODE__:pc:gnb:tvapps:main",
                    "familystory" : "A|__COUNTRY_CODE__:pc:gnb:familystory:main",
                    "allshareplay" : "A|__COUNTRY_CODE__:pc:gnb:allshareplay:main",
                    "findmymobile" : "A|__COUNTRY_CODE__:pc:gnb:findmymobile:main",
                    "chaton" : "A|__COUNTRY_CODE__:pc:gnb:chaton:main",
                    "ncomui-support" : "T|main:gnb:support",
                    "terms" : "T|common:account:terms",
                    "pdu" : "T|common:account:pdu",
                    "pp" : "T|common:account:pp",
                    "pdp" : "T|common:account:pdp",
                    "support" : "A|__COUNTRY_CODE__:pc:main:gnb:support"
                }
        };
        
        /*
            {
                "domain" : 도에인에서 찾을 문자열,
                "serviceCode" : 내부에서 사용할 서비스코드,
                "serviceCodeClass" : 헤더 메뉴 엘리먼트 찾기 위한 클래스명
            },
        */

        var __serviceInfo = {
                "ncom" : {
                    "domain" : "dev.content.samsung.com",
                    "serviceCode" : "ncom",
                    "serviceCodeClass" : "ncom",
                    "menuSelectClass" : "ncom"
                },
                "apps" : {
                    "domain" : "apps.samsung.com",
                    "serviceCode" : "apps",
                    "serviceCodeClass" : "ncomui-apps",
                    "menuSelectClass" : "ncomui-apps-group"
                },
                "tvapps" : {
                    "domain" : "tvapps.samsung.com",
                    "serviceCode" : "tvapps",
                    "serviceCodeClass" : "ncomui-tvapps",
                    "menuSelectClass" : "ncomui-apps-group"
                },
                "familystory" : {
                    "domain" : "familystory.samsung.com",
                    "serviceCode" : "familystory",
                    "serviceCodeClass" : "ncomui-familystory",
                    "menuSelectClass" : "ncomui-familystory"
                },
                "allshareplay" : {
                    "domain" : "link.samsung.com",
                    "serviceCode" : "allshareplay",
                    "serviceCodeClass" : "ncomui-allshareplay",
                    "menuSelectClass" : "ncomui-allshareplay"
                },
                "findmymobile" : {
                    "domain" : "findmymobile.samsung.com",
                    "serviceCode" : "findmymobile",
                    "serviceCodeClass" : "ncomui-findmymobile",
                    "menuSelectClass" : "ncomui-findmymobile"
                },
                "chaton" : {
                    "domain" : "chaton.samsung.com",
                    "serviceCode" : "chaton",
                    "serviceCodeClass" : "ncomui-chaton",
                    "menuSelectClass" : "ncomui-chaton"
                },
                "support" : {
                    "domain" : "help.content.samsung.com",
                    "serviceCode" : "support",
                    "serviceCodeClass" : "ncomui-support",
                    "menuSelectClass" : "ncomui-support"
                },
                "support2" : {
                    "domain" : "help.content.samsung.com",
                    "serviceCode" : "support2",
                    "serviceCodeClass" : "ncomui-support",
                    "menuSelectClass" : "ncomui-support"
                }
        };
        
        var __samsungAccountParamLocale = {"DZ":{"ar":"ar_DZ","DZ":"ar_DZ"},"AO":{"pt":"pt_AO","AO":"pt_AO"},"AR":{"es":"es_AR","AR":"es_AR"},"AM":{"hy":"hy_AM","AM":"hy_AM"},"AU":{"en":"en_AU","AU":"en_AU"},"AT":{"de":"de_AT","AT":"de_AT"},"AZ":{"az":"az_AZ","AZ":"az_AZ"},"BH":{"ar":"ar_BH","BH":"ar_BH"},"BD":{"bn":"bn_BD","BD":"bn_BD"},"BY":{"be":"be_BY","BY":"be_BY"},"BE":{"fr":"fr_BE","nl":"nl_BE","BE":"fr_BE"},"BA":{"sr":"sr_BA","BA":"sr_BA"},"BW":{"en":"en_BW","BW":"en_BW"},"BR":{"pt":"pt_BR","BR":"pt_BR"},"BG":{"bg":"bg_BG","BG":"bg_BG"},"CM":{"fr":"fr_CM","CM":"fr_CM"},"CA":{"en":"en_CA","fr":"fr_CA","CA":"en_CA"},"CL":{"es":"es_CL","CL":"es_CL"},"CN":{"zh":"zh_CN","CN":"zh_CN"},"CO":{"es":"es_CO","CO":"es_CO"},"CR":{"es":"es_CR","CR":"es_CR"},"HR":{"hr":"hr_HR","HR":"hr_HR"},"CY":{"el":"el_CY","CY":"el_CY"},"CZ":{"cs":"cs_CZ","CZ":"cs_CZ"},"CD":{"fr":"fr_CD","CD":"fr_CD"},"DK":{"da":"da_DK","DK":"da_DK"},"DO":{"es":"es_DO","DO":"es_DO"},"EC":{"es":"es_EC","EC":"es_EC"},"EG":{"ar":"ar_EG","EG":"ar_EG"},"SV":{"es":"es_SV","SV":"es_SV"},"EE":{"et":"et_EE","EE":"et_EE"},"FI":{"fi":"fi_FI","FI":"fi_FI"},"FR":{"fr":"fr_FR","FR":"fr_FR"},"GE":{"ka":"ka_GE","GE":"ka_GE"},"DE":{"de":"de_DE","DE":"de_DE"},"GH":{"en":"en_GH","GH":"en_GH"},"GR":{"el":"el_GR","GR":"el_GR"},"GT":{"es":"es_GT","GT":"es_GT"},"HN":{"es":"es_HN","HN":"es_HN"},"HK":{"zh":"zh_HK","HK":"zh_HK"},"HU":{"hu":"hu_HU","HU":"hu_HU"},"IS":{"is":"is_IS","IS":"is_IS"},"IN":{"hi":"hi_IN","IN":"hi_IN"},"ID":{"in":"in_ID","ID":"in_ID"},"IR":{"fa":"fa_IR","IR":"fa_IR"},"IQ":{"ar":"ar_IQ","IQ":"ar_IQ"},"IE":{"en":"en_IE","gd":"gd_IE","IE":"en_IE"},"IL":{"he":"he_IL","IL":"he_IL"},"IT":{"it":"it_IT","IT":"it_IT"},"CI":{"fr":"fr_CI","CI":"fr_CI"},"JM":{"en":"en_JM","JM":"en_JM"},"JP":{"ja":"ja_JP","JP":"ja_JP"},"JO":{"ar":"ar_JO","JO":"ar_JO"},"KZ":{"kk":"kk_KZ","KZ":"kk_KZ"},"KE":{"sw":"sw_KE","KE":"sw_KE"},"KR":{"ko":"ko_KR","KR":"ko_KR"},"KW":{"ar":"ar_KW","KW":"ar_KW"},"LV":{"lv":"lv_LV","LV":"lv_LV"},"LB":{"ar":"ar_LB","LB":"ar_LB"},"LY":{"ar":"ar_LY","LY":"ar_LY"},"LT":{"lt":"lt_LT","LT":"lt_LT"},"LU":{"fr":"fr_LU","LU":"fr_LU"},"MO":{"zh":"zh_MO","MO":"zh_MO"},"MK":{"mk":"mk_MK","MK":"mk_MK"},"MY":{"ms":"ms_MY","MY":"ms_MY"},"MU":{"en":"en_MU","MU":"en_MU"},"MX":{"es":"es_MX","MX":"es_MX"},"MD":{"ro":"ro_MD","MD":"ro_MD"},"ME":{"sr":"sr_ME","ME":"sr_ME"},"MA":{"ar":"ar_MA","MA":"ar_MA"},"MZ":{"pt":"pt_MZ","MZ":"pt_MZ"},"NA":{"en":"en_NA","NA":"en_NA"},"NP":{"ne":"ne_NP","NP":"ne_NP"},"NL":{"nl":"nl_NL","NL":"nl_NL"},"NZ":{"en":"en_NZ","NZ":"en_NZ"},"NI":{"es":"es_NI","NI":"es_NI"},"NG":{"en":"en_NG","NG":"en_NG"},"NO":{"no":"no_NO","NO":"no_NO"},"OM":{"ar":"ar_OM","OM":"ar_OM"},"PK":{"ur":"ur_PK","PK":"ur_PK"},"PA":{"es":"es_PA","PA":"es_PA"},"PY":{"es":"es_PY","PY":"es_PY"},"PE":{"es":"es_PE","PE":"es_PE"},"PH":{"en":"en_PH","PH":"en_PH"},"PL":{"pl":"pl_PL","PL":"pl_PL"},"PT":{"pt":"pt_PT","PT":"pt_PT"},"PR":{"es":"es_PR","PR":"es_PR"},"QA":{"ar":"ar_QA","QA":"ar_QA"},"CG":{"fr":"fr_CG","CG":"fr_CG"},"RO":{"ro":"ro_RO","RO":"ro_RO"},"RU":{"ru":"ru_RU","RU":"ru_RU"},"SA":{"ar":"ar_SA","SA":"ar_SA"},"SN":{"fr":"fr_SN","SN":"fr_SN"},"RS":{"sr":"sr_RS","RS":"sr_RS"},"SK":{"sk":"sk_SK","SK":"sk_SK"},"SI":{"sl":"sl_SI","SI":"sl_SI"},"ZA":{"en":"en_ZA","ZA":"en_ZA"},"ES":{"es":"es_ES","ES":"es_ES"},"LK":{"si":"si_LK","LK":"si_LK"},"SD":{"en":"en_SD","SD":"en_SD"},"SE":{"sv":"sv_SE","SE":"sv_SE"},"CH":{"de":"de_CH","fr":"fr_CH","CH":"de_CH"},"SY":{"ar":"ar_SY","SY":"ar_SY"},"TW":{"zh":"zh_TW","TW":"zh_TW"},"TZ":{"en":"en_TZ","TZ":"en_TZ"},"TH":{"th":"th_TH","TH":"th_TH"},"TT":{"en":"en_TT","TT":"en_TT"},"TN":{"ar":"ar_TN","TN":"ar_TN"},"TR":{"tr":"tr_TR","TR":"tr_TR"},"UG":{"en":"en_UG","UG":"en_UG"},"UA":{"uk":"uk_UA","UA":"uk_UA"},"AE":{"ar":"ar_AE","AE":"ar_AE"},"GB":{"en":"en_GB","GB":"en_GB"},"UY":{"es":"es_UY","UY":"es_UY"},"US":{"en":"en_US","US":"en_US"},"UZ":{"uz":"uz_UZ","UZ":"uz_UZ"},"VE":{"es":"es_VE","VE":"es_VE"},"VN":{"vi":"vi_VN","VN":"vi_VN"},"YE":{"ar":"ar_YE","YE":"ar_YE"},"SG":{"en":"en_SG","zh":"zh_SG","SG":"en_SG"},"BO":{"es":"es_BO","BO":"es_BO"},"ET":{"en":"en_ET","fr":"fr_ET","ET":"en_ET"},"RW":{"en":"en_RW","fr":"fr_RW","RW":"fr_RW"},"GA":{"en":"en_GA","fr":"fr_GA","GA":"fr_GA"},"CF":{"en":"en_CF","fr":"fr_CF","CF":"fr_CF"},"BI":{"en":"en_BI","fr":"fr_BI","BI":"fr_BI"},"SO":{"en":"en_SO","fr":"fr_SO","SO":"en_SO"},"MG":{"en":"en_MG","fr":"fr_MG","MG":"fr_MG"},"ZM":{"en":"en_ZM","fr":"fr_ZM","ZM":"en_ZM"},"ZW":{"en":"en_ZW","fr":"fr_ZW","ZW":"en_ZW"},"SZ":{"en":"en_SZ","fr":"fr_SZ","SZ":"en_SZ"},"LS":{"en":"en_LS","fr":"fr_LS","LS":"en_LS"},"TG":{"en":"en_TG","fr":"fr_TG","TG":"fr_TG"},"BJ":{"en":"en_BJ","fr":"fr_BJ","BJ":"fr_BJ"},"LR":{"en":"en_LR","fr":"fr_LR","LR":"en_LR"},"SL":{"en":"en_SL","fr":"fr_SL","SL":"en_SL"},"GN":{"en":"en_GN","fr":"fr_GN","GN":"fr_GN"}};        

        var __ncomui = {
            event : {
                type : {
                    COUNTRY_CLICKED_EVENT : Number(0),
                    COUNTRY_CODE_CHANGED_EVENT : Number(1),
                    LANGUAGE_CODE_CHANGED_EVENT : Number(2),
                    COUNTRY_AND_LANGUAGE_CODES_CHANGED_EVENT : Number(3),
                    SIGN_IN_CLICKED_EVENT : Number(4),
                    SIGN_OUT_CLICKED_EVENT : Number(5),
                    LINK_CLICKED_EVENT : Number(6),
                    ACCOUNT_CLICKED_EVENT  : Number(7)
                }
            },

            initilize : function(parameter) {
                __me = this;
                __me.initialize(parameter);
            },
            
            initialize : function(parameter) {

                var headerId = "ncomui-header";
                __me = this;
                
                if(typeof parameter == "object") {
                    if(typeof parameter.service != "undefined" && parameter.service != null){
                        __serviceCode = parameter.service;
                    }
                  
                    
                    if(typeof parameter.eventListener != "undefined" && parameter.eventListener != null)
                        __eventListener = parameter.eventListener;
                    
                    __me.getServiceCodeParam(__serviceCode);
                }
                else {
                    __me.getServiceCodeParam(__serviceCode);

                     __languageSelectType = 1;
                    for(var i = 0; i < __languageSelectType0SeviceCode.length; i++) {
                        if(__serviceCode == __languageSelectType0SeviceCode[i])
                        {
                            __languageSelectType = 0;
                            break;
                        }
                    }
                    __userAccount = parameter;
                }
                
                __headerId = headerId;
                __me.initEnv(parameter);
                
              
                if((__serverMode == "cn" || __country == "IN" || __country == "KR") || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))){
                    if(typeof parameter.userName != "undefined" && parameter.userName != null && parameter.userName != ''){
                        __userAccount = parameter.userName;
                    }
                    if(typeof parameter.email != "undefined" && parameter.email != null && parameter.email != ''){
                        __userAccount = parameter.email;
                    }

                }else{
                       if(typeof parameter.email != "undefined" && parameter.email != null){
                            __userAccount = parameter.email;
                        }
                }
                
                if(__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2")) ){   //ncomui cn서버 일경우
                    __primaryUrl = __primaryUrl.replace(".com", ".cn");
                    __primaryDomain = __primaryDomain.replace(".com", ".cn");
                }

                //ncomui 에 강제 redirect 로직 추가 - tvapps
                if(__serviceCode == 'tvapps' && 'KR' != __country){
                    if(__me.getCookie("representationLanguageYn") == "N"){
                        document.location.href = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/contents/aboutn/appsTvIntro.do";
                    }else{
                        document.location.href = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/contents/aboutn/appsTvIntro.do";
                    }
                }
                
                __fullBrowser = __me.getCookie("_full_browser");    //PC보기 쿠키
                //모바일 메인 URL
                if(__userAccount == ""){
                    if(__me.getCookie("representationLanguageYn") == "N"){
                        mobileHomeUrl = "http://" + __primaryUrl + "/mobile/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/main.do?_full_browser=N";
                    }else{
                        mobileHomeUrl = "http://" + __primaryUrl + "/mobile/" + ncomuiUrlNationCode + "/main.do?_full_browser=N";
                    }
                }else{
                    if(__me.getCookie("representationLanguageYn") == "N"){
                        mobileHomeUrl = "http://" + __primaryUrl + "/mobile/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/loginMain.do?_full_browser=N";
                    }else{
                        mobileHomeUrl = "http://" + __primaryUrl + "/mobile/" + ncomuiUrlNationCode + "/loginMain.do?_full_browser=N";
                    }
                }
                
                if(__country == "CN"){ //중국 관련 페이지 컨트롤
                    __me.ncomuiLoadingScript(__primaryStaticCommonUrl+"/static/ncomui/common/commonCn.js");
                } else { //글로벌 관련 페이지 컨트롤
                    __me.ncomuiLoadingScript(__primaryStaticCommonUrl+"/static/ncomui/common/commonGlobal.js");
                }
                
                redirectException();
                
                if("10" != __country) {
                    __linkUrl[__mode]["ncom"] = "http://" + __primaryUrl + "/";
                } else {
                    if(__userAccount == ""){
                        __linkUrl[__mode]["ncom"] = "http://" + __primaryUrl + "/global/main.do";
                    }else{
                        __linkUrl[__mode]["ncom"] = "http://" + __primaryUrl + "/global/loginMain.do";
                    }
                }
                
                if("10" != __country && __me.getCookie("_common_country") && __country != __me.getCookie("_common_country")){
                    if(__me.getCookie("representationLanguageYn") == "N"){
                        __linkUrl[__mode]["ncomui-aboutus"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/contents/aboutn/aboutnIntro.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-news"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/support/notice/noticeList.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-event"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/event/eventList.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-sitemap"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/common/getSitemap.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-social-n"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/socialn/socialnList.do?_common_country=" + __me.getCookie("_common_country");
                    }else{
                        __linkUrl[__mode]["ncomui-aboutus"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/contents/aboutn/aboutnIntro.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-news"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/support/notice/noticeList.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-event"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/event/eventList.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-sitemap"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/common/getSitemap.do?_common_country=" + __me.getCookie("_common_country");
                        __linkUrl[__mode]["ncomui-social-n"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/socialn/socialnList.do?_common_country=" + __me.getCookie("_common_country");
                    }
                } else {
                    if(__me.getCookie("representationLanguageYn") == "N"){
                        __linkUrl[__mode]["ncomui-aboutus"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/contents/aboutn/aboutnIntro.do";
                        __linkUrl[__mode]["ncomui-news"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/support/notice/noticeList.do";
                        __linkUrl[__mode]["ncomui-event"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/event/eventList.do";
                        __linkUrl[__mode]["ncomui-sitemap"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/common/getSitemap.do";
                        __linkUrl[__mode]["ncomui-social-n"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/socialn/socialnList.do";
                    }else{
                        __linkUrl[__mode]["ncomui-aboutus"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/contents/aboutn/aboutnIntro.do";
                        __linkUrl[__mode]["ncomui-news"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/support/notice/noticeList.do";
                        __linkUrl[__mode]["ncomui-event"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/event/eventList.do";
                        __linkUrl[__mode]["ncomui-sitemap"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/common/getSitemap.do";
                        __linkUrl[__mode]["ncomui-social-n"] = "http://" + __primaryUrl + "/" + ncomuiUrlNationCode + "/socialn/socialnList.do";
                    }
                }
                
                __linkUrl[__mode]["ncomui-support"] = "javascript:goSupport()";
                __linkUrl[__mode]["ncomui-upoint"] = "http://www.samsungblue.co.kr";
                //__linkUrl[__mode]["ncomui-support"] = "http://help.content.samsung.com/csweb/auth/gosupport.do";
                
                if(__serverMode == "cn"){   //ncomui cn서버 일경우
                    if(__mode == "prd"){
                        __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                        __linkUrl[__mode]["chaton"] = "http://chaton.samsung.com";
                        __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                        __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                        __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                        __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                    } else if(__mode == "stg") {
                        __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                        __linkUrl[__mode]["chaton"] = "http://stg.web.samsungchaton.com";
                        __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                        __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                        __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                        __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                    } else {
                        __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                        __linkUrl[__mode]["chaton"] = "http://value.samsungchaton.com";
                        __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                        __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                        __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                        __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                    }
                    
                }else{  //global일 경우
                    // 중국향 서비스 링크 적용
                    if(__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2")){
                        if(__mode == "prd"){
                            __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                            __linkUrl[__mode]["chaton"] = "http://chaton.samsung.com";
                            __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                            __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                            __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                            __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                        } else if(__mode == "stg") {
                            __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                            __linkUrl[__mode]["chaton"] = "http://stg.web.samsungchaton.com";
                            __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                            __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                            __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                            __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                        } else {
                            __linkUrl[__mode]["apps"] = "http://samsungapps.sina.cn/main/getMain.as";
                            __linkUrl[__mode]["chaton"] = "http://value.samsungchaton.com";
                            __linkUrl[__mode]["allshareplay"] = "http://link.samsung.cn";
                            __linkUrl[__mode]["findmymobile"] = "http://findmymobile.samsung.cn";
                            __linkUrl[__mode]["findmymobileinit"] = "http://findmymobile.samsung.cn/account/init.do";
                            __linkUrl[__mode]["familystory"] = "http://familystory.samsung.cn";
                        }
                    }
                    
                }
                
                __me.resourceCreate();
                
                //omniture 관련 js 임포트
                if(__mode == 'prd'){
                    __me.ncomuiLoadScript(window.location.protocol + "//" + __primaryStaticUrl + "/omniture/s_ncomui_code.js", function(){ncomui.omnitureImport();ncomui.omnitureOnloadCall();});
                } else {
                    __me.ncomuiLoadScript(window.location.protocol + "//" + __primaryStaticUrl + "/omniture/s_ncomui_code_dev.js", function(){ncomui.omnitureImport();ncomui.omnitureOnloadCall();});
                }
                
                __serviceId = parameter.serviceId;
                
                function checkDate(regidate){                   
                    var regiyear = parseInt(regidate.substr(0,4), 10);
                    var regimonth = parseInt(regidate.substr(4,2), 10) -1;
                    var regiday = parseInt(regidate.substr(6,2), 10);
                    var regiHours = parseInt(regidate.substr(8,2), 10);
                    var regiMinutes = parseInt(regidate.substr(10,2), 10);
                    
                    var curDate = new Date();
                    var curYear = curDate.getFullYear();  
                    var curMonth = curDate.getMonth();
                    var curDay = curDate.getDate();
                    var curHours = curDate.getHours();
                    var curMinutes = curDate.getMinutes();
                    
                    if(new Date(curYear, curMonth, curDay, curHours, curMinutes, 0) < (new Date(regiyear, regimonth, regiday, regiHours, regiMinutes, 0) )){
                        return false;
                    } else {
                        if(new Date(curYear, curMonth, curDay, curHours, curMinutes, 0) < (new Date(regiyear, regimonth, regiday + 3, regiHours, regiMinutes, 0) )){
                            return true;
                        } else {
                            return false;
                        }
                    }
                }
                
                
                function setNewCookies(regiDate, cKey, cValue, exDay){
                    var regiyear = parseInt(regiDate.substr(0,4), 10);
                    var regimonth = parseInt(regiDate.substr(4,2), 10) -1;
                    var regiday = parseInt(regiDate.substr(6,2), 10);
                    var cookieStartDate = new Date(regiyear, regimonth, regiday, 0, 0, 0)
                    
            
                    var expire = cookieStartDate;
                    expire.setDate(expire.getDate() + exDay);
                    var cookies = cKey + '=' + escape(cValue) + '; path=/; domain=' + __primaryDomain; // 한글 깨짐을 막기위해 escape(cValue)를 합니다.
                    if(typeof exDay != 'undefined') cookies += ';expires=' + expire.toGMTString();
                    document.cookie = cookies;
                }
                
                jsonpcallback = function(data) {
                    var openDate = data.dateHour;
                    
                    if(data.dateHour < data.approveDate ) {
                        openDate = data.approveDate;
                    }
                    
                    if(data.fileName == "event") {
                        if(ncomui.getCookie(data.nationCode +  openDate + 'EVT') == '' && checkDate(openDate)){
                       
                            var newText ='<em class="blind">'+getNcomuiMessageBundleValue('v2_pc_common_t0003')+'</em>';
                            $(".ncomui-event > a").addClass("new").append(newText);
                            $(".ncomui-event > a").click(function(){
                                setNewCookies(openDate, data.nationCode +  openDate + 'EVT', 'Y', 3);                                    
                            });
                        }
                    }        
                    if(data.fileName == "notice") {                    
                        if(ncomui.getCookie(data.nationCode +  openDate + 'NTC') == '' && checkDate(openDate)){
                            var newText ='<em class="blind">'+getNcomuiMessageBundleValue('v2_pc_common_t0003')+'</em>';
                            $(".ncomui-news > a").addClass("new").append(newText);;
                            $(".ncomui-news > a").click(function(){
                                setNewCookies(openDate, data.nationCode +  openDate + 'NTC', 'Y', 3);
                            });
                        }
                    }
                }
                
                setTimeout(function() {
                                                          
                   $.ajax({
                        url: window.location.protocol + "//" + __primaryStaticUrl.replace('.cn', '.com') +  "/upload/ncomui/"  + __country + "/event.json",
                        dataType : "jsonp",
                        jsonpCallback: "ncomui.jsonpcallback",
                        cache : true,
                        success: function(data) {
                            
                        },
                        error : function(jqXHR, textStatus, errorThrown){
                            
                        }                        
                    });
                    
                    $.ajax({
                        url: window.location.protocol + "//" + __primaryStaticUrl.replace('.cn', '.com') +  "/upload/ncomui/"  + __country + "/notice.json",
                        dataType : "jsonp",
                        jsonpCallback: "ncomui.jsonpcallback",
                        cache : true,
                        success: function(data) {
                            
                        },
                        error : function(jqXHR, textStatus, errorThrown){                        
                            
                        }                        
                    });
                    
                });
                
            },

            getServiceCodeParam : function(param) {
                try{
                    __serviceCode = __serviceInfo[param].serviceCode;
                    __serviceCodeClass = __serviceInfo[param].serviceCodeClass;
                    __menuSelectClass = __serviceInfo[param].menuSelectClass;
                }
                catch(e) {
                    alert("지정된 서비스 코드가 없습니다.(" + param + ")");
                }
            },

            initEnv : function(parameter) {
                if(__initEnv == true) return;
                __country = parameter.country.toUpperCase();
                
                if("10" == __country) {
                    ncomuiUrlNationCode = "global";
                } else if("GB" == __country) {
                    ncomuiUrlNationCode = "uk";   
                } else {
                    ncomuiUrlNationCode = __country.toLowerCase();
                }
            },

            resourceCreate : function() {
                __me.styleCreate();
            },

            styleLoadComplete : function() {
                __me.headerCreate(__headerId);
                __me.footerCreate();
                // 국가별 로고 기준 클래스
                var __headerNcomuiLangClass;
                // 대표언어 그룹에 속하지 않는 예외 국가의 locale
                if("10" == __country){
                    __headerNcomuiLangClass = __language;
                }else{
                    try{
                        var __headerAdditionalLogoNationLocale = eval('headerAdditionalLogoNationLocale.'+__country);
                        if(__headerAdditionalLogoNationLocale != undefined){
                            __headerNcomuiLangClass = __headerAdditionalLogoNationLocale;
                        }else {
                            __headerNcomuiLangClass = __language;
                        }
                    }catch(e) {
                        __headerNcomuiLangClass = __language;
                    }
                }
                
                //다중언어 국가 예외처리
                if(__country == "CH" && __headerNcomuiLangClass == "de"){
                    __headerNcomuiLangClass = "de_ch";
                }
                
                $('#ncomui-header').attr('class','ncomui-lang-'+__headerNcomuiLangClass);
                
                $('#ncomui-footer').attr('class','ncomui-lang-'+__language);
                $("body").show();

                function fncLoop() {
                    $('#common-banner').each(function() {
                        var bannerNum = $(this).find('img').length;
                        if (bannerNum != null) {
                            if ($('#ncomui-contents').height() < $('#ncomui-aside').height()+100) {
                                $(this).css({'position': 'static',paddingTop : 20});
                            }
                            else {
                                $(this).css({'position': 'absolute', 'bottom': 0});
                            }
                        }
                    }).show();
                    if ($('.ncomui-footer-nav ul').width() > 570) $('.ncomui-copyright').css({'clear':'both','float':'none'}) ;
                    var footerSocial = {
                        facebook : $('.ncomui-footer-section').width() + 10,
                        twitter : $('.ncomui-footer-section').width() + 30
                    }
                    var cssFloat;
                    if ($('html').attr('dir') == 'rtl') cssFloat = 'right';
                    else cssFloat = 'left';
                    $('.ncomui-facebook').css(cssFloat,footerSocial.facebook);
                    $('.ncomui-twitter').css(cssFloat,footerSocial.twitter);
                }
                var ttt = setTimeout(fncLoop, 10);
            },

            hasService : function(service) {
                if(typeof __serviceCodes[__country] == "undefined" || (typeof __serviceCodes[__country] != "undefined" && typeof __serviceCodes[__country][service] != "undefined"))
                    return true;
                return false;
            },

            styleCreate : function() {
                __me.styleLoadComplete();
            },

            headerCreate : function(id) {
                var element = $("#" + id);
                if(element.length <= 0) return;

                var htmls = new Array();
                
                htmls.push('<div class="ncomui-align-content">');
                htmls.push('    <h1 class="ncomui-logo"><a class="sec" href="#" ><em class="blind">Samsung</em></a><a class="cns" href="#"><em class="blind">' + getNcomuiMessageBundleValue('v6_tv_aboutn_main_t0002') + '</em></a></h1>');
                htmls.push('    <!-- navigation -->');
                htmls.push('    <nav class="ncomui-location-nav">');
                htmls.push('        <ul>');
                if(__userAccount != ""){
                    htmls.push('            <li class="ncomui-account">severely@samsung.com');
                    htmls.push('                <div id="SSProfilePop" style="display: none;">');
                    htmls.push('                     <div class="profile-wrap clearfix">');
                    htmls.push('                          <div class="floatl">');
                    if (__language == 'ko' ) {
                        htmls.push('                           <img src="'+__primaryStaticCommonUrl+'/static/ncomui/assets/tmp/thumb_top_d.jpg" width="62" height="62" alt="'+ getNcomuiMessageBundleValue('v6_pc_main_profile_t0004') +'">');
                    }else{
                        htmls.push('                           <img src="'+__primaryStaticCommonUrl+'/static/ncomui/assets/tmp/thumb_top_d.jpg" width="62" height="62" alt="">');
                    }
                    htmls.push('                               <a href="#">' + getNcomuiMessageBundleValue('v6_pc_profile_t0003') + '</a>');
                    htmls.push('                          </div>');
                    htmls.push('                          <div class="floatr">');
                    htmls.push('                               <p class="pp-name"></p>');
                    
                    htmls.push('                              <div>');
                    htmls.push('                                   <p class="pp-birth"><strong>' + getNcomuiMessageBundleValue('v6_pc_profile_t0001') + '</strong>1980.10.21</p>');
                    htmls.push('                                   <p class="pp-country"><strong>' + getNcomuiMessageBundleValue('v6_pc_profile_t0002') + ' </strong>Korea</p>');
                    htmls.push('                              </div>');
                    htmls.push('                          </div>');
                    htmls.push('                          <a href="#" id="pop-profile-close"><img src="'+__primaryStaticCommonUrl+'/static/ncomui/assets/infolayer_close.gif" alt="'+ getNcomuiMessageBundleValue('v2_dev_add_photo_t0001') +'" width="11" height="11"></a>');
                    htmls.push('                    </div>');
                    htmls.push('                </div>');
                    htmls.push('            </li>');
                }    
                htmls.push('            <li class="ncomui-sign"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0007')+'</a></li>');
                htmls.push('            <li class="ncomui-support"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui4_t0001')+'</a></li>');
                htmls.push('            <li class="ncomui-news"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0004')+'</a></li>');
                htmls.push('            <li class="ncomui-event"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0005')+'</a></li>');
                
                
                 if(__serviceCode == "chaton"){
                    if(location.href.indexOf("_common_lang=ko") > -1){
                        htmls.push('            <li class="ncomui-upoint"><a href="#" target="_blank">U-Point</a></li>');   
                    }
                }else{
                    if('KR' == __country && __language == 'ko'){
                            htmls.push('            <li class="ncomui-upoint"><a href="#" target="_blank">U-Point</a></li>');   
                    }
                }
                
                htmls.push('        </ul>');
                htmls.push('    </nav>');
                htmls.push('    <!-- //navigation -->');
                htmls.push('    <!-- GNB -->');
                if (__language == 'ko' ) {
                    htmls.push('    <nav class="ncomui-global-nav ko-ncomui-global-nav">');
                }else{
                    htmls.push('    <nav class="ncomui-global-nav">');
                }
                htmls.push('        <ul>');
                
                if(__me.hasService("apps") == true) {
                    htmls.push('            <li class="ncomui-apps-group"><span><a href="#">'+getNcomuiMessageBundleValue('v5_apps_C0401_t0001')+'</a></span>');
                    htmls.push('                <ul>');
                    htmls.push('                    <li class="ncomui-mobileapps"><span><a href="#">Mobile</a></span></li>');
                    htmls.push('                    <li class="ncomui-tvapps"><span><a href="#">TV</a></span></li>');
                    htmls.push('                </ul>');
                    htmls.push('            </li>');
                }
                
                if(__me.hasService("chaton") == true) {
                    htmls.push('            <li class="ncomui-chaton"><span><a href="#">ChatON</a></span></li>');
                }
                
                if(__me.hasService("allshareplay") == true) {
                    htmls.push('            <li class="ncomui-allshareplay"><span><a href="#">'+getNcomuiMessageBundleValue('v5_main_C0401_t0024')+'</a></span></li>');
                }
            
                //2012-10-12 support 조기 open 에 따른 예외처리
                if(__me.hasService("familystory") == true  && __serviceCode =='familystory' ) {
                    htmls.push('            <li class="ncomui-familystory"><span><a href="#">Family Story</a></span></li>');
                }
                         
                if(__me.hasService("findmymobile") == true) {
                    htmls.push('            <li class="ncomui-findmymobile"><span><a href="#">'+getNcomuiMessageBundleValue('front_msg_C0401_t013')+'</a></span></li>');
                }
                htmls.push('            <li class="ncomui-aboutus"><span><a href="#">'+getNcomuiMessageBundleValue('v6_pc_main_gnb_t0001')+'</a></span></li>');
                
                htmls.push('        </ul>');
                htmls.push('    </nav>');
                htmls.push('    <!-- //GNB -->');
                htmls.push('</div>');
                
                var loginYn = "false";
                var logoutYn = "true";
                
                if(__me.getCookie("iPlanetDirectoryPro") != "") {
                    loginYn = "true";
                    logoutYn = "false";
                }
                
                htmls.push('<form id="goSupportFrom" name="goSupportFrom" method="post" action="http://help.content.samsung.com/csweb/auth/gosupport.do ">');
                htmls.push('    <input type="hidden" id="serviceCd" name="serviceCd" value="nservice" />');
                htmls.push('    <input type="hidden" id="targetUrl" name="targetUrl" value="" />');
                htmls.push('    <input type="hidden" id="chnlCd" name="chnlCd" value="web" />');
                htmls.push('    <input type="hidden" id="_common_check_sso_login" name="_common_check_sso_login" value="'+loginYn+'" />');
                htmls.push('    <input type="hidden" id="_common_check_sso_logout" name="_common_check_sso_logout" value="'+logoutYn+'" />');
                htmls.push('    <input type="hidden" id="_common_country" name="_common_country" value="'+__country+'" />');
                htmls.push('    <input type="hidden" id="_common_lang" name="_common_lang" value="'+ __language+'" />');
                htmls.push('    <input type="hidden" id="guid" name="guid" value="'+ __me.getCookie("uid") +'" />');
                htmls.push('    <input type="hidden" id="tokenId" name="tokenId" value="" />');
                if(__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))){
                    htmls.push('    <input type="hidden" id="isChn" name="isChn" value="true" />');
                }
                htmls.push('</form>');
                
                var html = htmls.join("");
                
                var current = "class=\"current\"";
                if(__serviceCode != "ncom")
                    current = "";

                html = html.replace(new RegExp("__CURRENT__", "gi"), current);

                if(__userAccount != ""){
                    html = html.replace(new RegExp("severely@samsung.com", "gi"), '<a href="#">' + __userAccount + '</a>');
                }
                if(__userAccount != "") {
                    html = html.replace(new RegExp(getNcomuiMessageBundleValue('v2_pc_ncomui_t0007'), "gi"), getNcomuiMessageBundleValue('v2_pc_ncomui_t0007'));
                }
                else {
                    html = html.replace(new RegExp(getNcomuiMessageBundleValue('v2_pc_ncomui_t0007'), "gi"), getNcomuiMessageBundleValue('v2_pc_ncomui_t0001'));
                }

                element.html(html);

                if(__serviceCodeClass != "") {
                    element = $("#" + id + " ." + __menuSelectClass);
                    if(element.length > 0) {
                        element.addClass("ncomui-current");
                    }
                }
                if (__language == 'ko' ) {
                    $(".ncomui-apps-group").addClass("ncomui-hover");
                }
                
                __me.bindHeader(id);
                
                if (__language == 'ko' ) {
                    $('.ncomui-hover').find('>span>a').focus(function(){
                        $(this).parent('span').next('ul').show();
                    });
                    $('.ncomui-chaton').find('a').focus(function(){
                        $('.ncomui-hover').find('ul').hide();    
                    });
                    $('.ncomui-hover').find('>span>a').keydown(function(e){
                        if(e.shiftKey && e.keyCode == 9){
                            $('.ncomui-hover').find('ul').hide();
                        };
                    })
                }
            },
            
            footerCreate : function() {
                var id = "ncomui-footer-nav";
                var element = $("." + id);
                if(element.length <= 0) return;

                var htmls = new Array();
                
                htmls.push('        <ul>');

                if (__language == 'ko' ) {
                    htmls.push('            <li class="ncomui-terms-conditions ncomui-first"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0013')+'</a></li>');
                    htmls.push('            <li class="ncomui-privacy-collect"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0014')+'</a></li>');                
                    htmls.push('            <li class="ncomui-privacy"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0016')+'</a></li>');
                } else {
                    htmls.push('            <li class="ncomui-terms-conditions ncomui-first"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0009')+'</a></li>');                                
                    htmls.push('            <li class="ncomui-privacy-collect"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0014')+'</a></li>');                
                    htmls.push('            <li class="ncomui-privacy"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0010')+'</a></li>');
                }

                htmls.push('            <li class="ncomui-privacy-handle"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0017')+'</a></li>');
                
                if((__serviceCode == 'apps' || __serviceCode == 'ncom') && __country == "KR" && __serverMode != "cn"){
                    htmls.push('            <li class="ncomui-youth-policy"><a href="#">청소년 보호정책</a></li>');
                }
                
                htmls.push('            <li class="ncomui-social-n"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0011')+'</a></li>');
                htmls.push('            <li class="ncomui-sitemap"><a href="#">'+getNcomuiMessageBundleValue('v2_pc_ncomui_t0008')+'</a></li>');  
                
                if (__language == 'ko' ) {
                    htmls.push('            <li class="ncomui-ideaboard"><a href="#">'+getNcomuiMessageBundleValue('v6_pc_idea_t0001')+'</a></li>');
                } else {
                    htmls.push('            <li class="ncomui-ideaboard"><a href="#">'+getNcomuiMessageBundleValue('v6_pc_idea_t0001')+'</a></li>');
                }
                
                if(footerWebsitecreditsNationCode.indexOf(__country) > -1){
                    htmls.push('            <li class="ncomui-website-credits"><a href="#">'+getNcomuiMessageBundleValue("v4_pc_add_t0001")+'</a></li>');
                } 
                
                //2012-10-24 페이스북, 트위터 제거 요청
                /*
                if(__serviceCode == 'ncom'){
                    htmls.push('            <li class="ncomui-facebook"><span title="facebook">Facebook</span></li>');
                    htmls.push('            <li class="ncomui-twitter"><span title="twitter">twitter</span></li>');
                }
                */
                htmls.push('        </ul>');
                
                
                if(__serviceCode == "chaton"){
                    if(location.href.indexOf("_common_lang=ko") > -1){
                        $('.ncomui-footer-nav').before('<p class="ncomui-wa-mark">웹 접근성 우수 사이트</p>');   
                    }
                }else{
                    if('KR' == __country && __language == 'ko'){
                        $('.ncomui-footer-nav').before('<p class="ncomui-wa-mark">웹 접근성 우수 사이트</p>');   
                    }
                }
                
                
                //20121024 한국 apps 푸터추가 + 20130822 호스팅 제공자 추가
                if(__serviceCode == 'apps' && __country == "KR" && __serverMode != "cn"){
                    htmls.push('        <div class="kr_apps">');
                    htmls.push('            <p>');
                    htmls.push('                주소: 경기도 수원시 영통구 삼성로 129 (매탄동) | 삼성전자 주식회사 대표이사: 권오현 | 사업자 등록번호: 124-81-00998 | <br />대표전화: 1588-3366 | 통신판매업신고번호: 2000-경기수원-0515호 <a href="http://www.ftc.go.kr/info/bizinfo/communicationView.jsp?apv_perm_no=2000374001130200515&area1=&area2=&currpage=1&searchKey=04&searchVal=1248100998&stdate=&enddate=" target="_blank" title="새 창">사업자정보확인</a>');
                    htmls.push('                <br>호스팅 서비스 제공자 : 삼성SDS 주식회사');
                    htmls.push('            </p>');
                    htmls.push('            <p>');
                    htmls.push('                삼성Apps의 상품은 전자상거래법 제17조에 의거, 단순변심에 의한 환불(청약철회)이 불가능합니다.<br />삼성전자주식회사가 운영하는 삼성Apps에 등록된 판매상품과 상품의 내용은 판매자가 등록한 것으로, <br />삼성전자주식회사는 중개시스템만 제공하며 그 등록내용에 대하여 일체의 책임을 지지 않습니다.');
                    htmls.push('            </p>');
                    htmls.push('        </div>');
                }
                
                if("AU" == __country) {
                    htmls.push('        <p class="ncomui-copyright">Copyright &copy; <span>Samsung Electronics</span> Australia Pty Ltd. All Rights Reserved.</p>');
                    
                }else{
                    htmls.push('        <p class="ncomui-copyright">Copyright &copy;2013-2014 <span>Samsung Electronics</span> Co., Ltd. All rights reserved.</p>');
                }
                //20121024 중국메인 푸터 추가
                if(__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))){
                    htmls.push('        <br />');
                    htmls.push('        <div class="ch_main">');
                    htmls.push('            <p>');
                    
                    if(__serviceCode == 'apps'){
                        htmls.push('                <a href="http://www.qq.com/culture.shtml" target="_blank">粤网文[2011]0483-070号</a> | <a href="http://www.qq.com/icp.shtml" target="_blank">增值电信业务经营许可证：粤B2-20090059</a> | <a href="http://www.qq.com/icp1.shtml" target="_blank">B2-20090028</a>');
                    }else if(__serviceCode == 'chaton'){
                        htmls.push('                <a href="http://www.miibeian.gov.cn/publish/query/indexFirst.action" target="_blank">京ICP备05022595号</a> | <a href="http://www.sina.com.cn/license/telecom09.html" target="_blank">增值电信业务经营许可证 B2-20090108</a> | <a href="http://www.sina.com.cn/licence/www0003.html" target="_blank">京网文[2011]0407-139号</a> | 京公网安备110000000016号');
                    }else{
                        htmls.push('                <a href="http://www.miibeian.gov.cn/" target="_blank">京ICP备05068163号-18</a>');
                    }
                    
                    htmls.push('            </p>');
                    htmls.push('        </div>');
                }
                
                element.html(htmls.join(""));

                __me.bindFooter(id);
                
                __me.hideSns();
                                
                if(__fullBrowser == "Y" && !(location.href.indexOf("hubMicrosite.do") > -1 && __serviceCode == "ncom")){
                    $("#ncomui-footer").after('<div id="view_mobile"><a href="' + mobileHomeUrl + '" onclick="trackClicks(\'footer:fullbrowser:pctomobile\');"><span>' + getNcomuiMessageBundleValue("pc_msg_C0401_t0002") + '</span></a></div>');
                    $('body').addClass('access_mobile');
                    
                    var viewMobileElement = $("#view_mobile > a");
                    if(viewMobileElement.length <= 0) return;
                    viewMobileElement.unbind("click");
                    viewMobileElement.bind("click", function(e) {
                        __me.setCookie('_full_browser', 'N', 1);
                    });
                }
            },

            bindHeader : function(id) {
                __me.bindSiteLink(id);
                
                if(__userAccount != ""){
                    __me.bindAccountInfo(id);
                }
                __me.bindLogin(id);
                __me.bindAbout(id);
                __me.bindSupport(id);
                __me.bindNews(id);
                __me.bindEvent(id);
                __me.bindSamsung(id);
                __me.bindUpoint(id);
            },

            bindFooter : function(id) {
                __me.bindSitemap(id);
                __me.bindTerms(id);
                __me.bindPrivacy(id);
                __me.bindPrivacyHandle(id);
                __me.bindPrivacyCollect(id);
                __me.bindYouthPolicy(id); //청소년 보호정책
                __me.bindSocialN(id);
                //__me.bindFacebook(id);
                //__me.bindTwitter(id);
                __me.bindWebsiteCredits(id);
                __me.bindideaBoard(id);
            },
            
            hideSns : function() {
                $.ajax({
                    url: window.location.protocol + "//" + __primaryUrl + "/svc/ajax/socialn/isShowSnsPaperJson?nationCode=" + __country,
                    dataType : "jsonp",
                    jsonpCallback: "jsonpCallback2",
                    cache : true,
                    success: function(data) {
                        if(typeof data != "undefined" && typeof data["twitterUseYn"] != "undefined" && typeof data["facebookUseYn"] != "undefined") {
                            if(data["twitterUseYn"]  == "N" && data["facebookUseYn"] == "N") {
                                $(".ncomui-social-n").hide();
                                $("#ncomSocialNOnSiteMap").hide();  // ncom의 사이트맵의 sns 링크 
                            }
                            
                            if(data["twitterUseYn"]  == "N") {
                                $(".ncomui-twitter").hide();
                            }
                            
                            if(data["facebookUseYn"] == "N") {
                                $(".ncomui-facebook").hide();
                            }
                        }
                    }
                });
            },
            
            processEventListenerRef : function(){
                if(typeof __eventListener == "undefined" || __eventListener == null) return false;
                var evt = new __clsEvent();

                evt.type = __me.event.type.LINK_CLICKED_EVENT;
                __eventListener(evt);
                
                if(evt.stop == false)
                    return false;
                return true;
            },
            
            processEventListener : function(e){
                if(typeof __eventListener == "undefined" || __eventListener == null) return false;
                //if(!($.browser.msie == true && parseFloat($.browser.version, 10) < 9.0))
                if(e.button || e.ctrlKey == true) return false;
                
                var evt = new __clsEvent();

                evt.type = __me.event.type.LINK_CLICKED_EVENT;
                __eventListener(evt);
                
                if(evt.stop == false)
                    return false;
                return true;
            },
            
            bindSiteLink : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-logo > .cns"), "C", "ncomui-logo", "ncom");
                __me.bindSamsung(id);
                
                __me.bindSiteLinkEx($("#" + id + " .ncomui-apps-group > span > a"), "C", "ncomui-apps-group", "apps");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-tvapps > span > a"), "C", "ncomui-tvapps", "tvapps");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-mobileapps > span > a"), "C", "ncomui-mobileapps", "apps");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-allshareplay > span > a"), "C", "ncomui-allshareplay", "allshareplay");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-familystory > span > a"), "C", "ncomui-familystory", "familystory");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-findmymobile > span >  a"), "C", "ncomui-findmymobile", "findmymobile");
                __me.bindSiteLinkEx($("#" + id + " .ncomui-chaton > span > a"), "C", "ncomui-chaton", "chaton");
                
            },
            
            bindSiteLinkEx : function(elementO, targetType, cls, service) {
                
                if(elementO.length <= 0) return;
                
                var element= $(elementO);
                var linkUrl;
                
                if(typeof service == "undefined")
                    linkUrl = __linkUrl[__mode][cls];
                else
                    linkUrl = __linkUrl[__mode][service];
                
                //내 디바이스 찾기일 경우, 로그인 후 Link는 변경
                if(service == "findmymobile") {
                    if(__userAccount != "") {
                        linkUrl = __linkUrl[__mode]["findmymobileinit"];
                    }
                }
                
                if(__serviceCode != "chaton" && service == "chaton") {
                    var url = linkUrl;
                    url +=  "?_common_country=" + __me.getCookie("_common_country") + "&_common_lang=" + __me.getCookie("_common_lang");
                    if(__userAccount == ""){
                        url += "&_common_check_sso_logout=true";
                    }else{
                        url += "&_common_check_sso_login=true";
                    }
                    
                    var chatonCookieValueId = __me.getCookie("_common_saveEmail");
                    if(chatonCookieValueId != null && chatonCookieValueId !=""){
                        chatonCookieValueId = encodeURIComponent(__me.base64enco(decodeURIComponent(chatonCookieValueId)));
                        url += "&cse=" + chatonCookieValueId;
                    }
                    
                    if(__fullBrowser == "Y"){
                        url += "&_full_browser=Y";
                    }
                    
                    linkUrl = url;
                }

                if((__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))) && __serviceCode != "apps" && service == "apps") {
                    var url = linkUrl;
                    url +=  "?_common_country=" + __me.getCookie("_common_country") + "&_common_lang=" + __me.getCookie("_common_lang");
                    if(__userAccount == ""){
                        url += "&_common_check_sso_logout=true";
                    }else{
                        url += "&_common_check_sso_login=true";
                    }
                    
                    var appsCookieValueId = __me.getCookie("_common_saveEmail");
                    if(appsCookieValueId != null && appsCookieValueId !=""){
                        appsCookieValueId = encodeURIComponent(__me.base64enco(decodeURIComponent(appsCookieValueId)));
                        url += "&cse=" + appsCookieValueId;
                    }
                    
                    if(__fullBrowser == "Y"){
                        url += "&_full_browser=Y";
                    } 
                               
                    linkUrl = url;
                }
                
                if(cls != "ncomui-support"){    //support인 경우 제외
                    if((__serviceCode == "chaton" && service != "chaton") || (__serverMode == "cn" && __serviceCode == "apps" && service != "apps" && service != "chaton")) {
                        if(service != "apps" || !(__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2")))){
                            var url = linkUrl;
                            url +=  "?_common_country=" + __me.getCookie("_common_country") + "&_common_lang=" + __me.getCookie("_common_lang");
                        }
                        
                        if(service != "apps" && (__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2")))){
                            if(__userAccount == ""){
                                url += "&_common_check_sso_logout=true";
                            }else{
                                url += "&_common_check_sso_login=true";
                            }
                        }
                        
                        if(__fullBrowser == "Y"){
                            url += "&_full_browser=Y";
                        }
                        
                        linkUrl = url;
                    }
                }
                
                //콘텐츠&서비스 
                if(__country == 'KR' && service =='ncom'){
                    element.attr({title: "삼성 콘텐츠 & 서비스 메인페이지로 이동"});
                }
                
                
                
                if(element.get(0).tagName == 'A'){
                    element.attr("href", linkUrl);
                    if(targetType == "N"){
                        element.attr("target", "_blank");
                    }
                    
                    if(__fullBrowser == "Y"){
                        if(service == "chaton" || service == "allshareplay"){
                            if(service == "chaton"){
                                __mobileLinkUrl[__mode][service] = linkUrl;
                                element.attr("href", "javascript:ncomui.goMobileConfirm('chaton')");
                            }else if(service == "allshareplay"){
                                __me.setCookie('_onlyOne','Y',1);
                                if(__me.getCookie("representationLanguageYn") == "N"){
                                    __mobileLinkUrl[__mode][service] = "http://" + __NCOM_CONSTANT_DYNAMIC_DOMAIN + "/mobile/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/contents/aboutn/samsungLinkIntro.do";
                                }else{
                                    __mobileLinkUrl[__mode][service] = "http://" + __NCOM_CONSTANT_DYNAMIC_DOMAIN + "/mobile/" + ncomuiUrlNationCode + "/contents/aboutn/samsungLinkIntro.do";
                                }
                                element.attr("href", "javascript:ncomui.goMobileConfirm('allshareplay')");
                            }
                        }
                    }
                }
                
                var omnitureClickName;
                if(typeof service == "undefined" && cls != "ncomui-support"){
                    omnitureClickName = __me.getOmnitureClickName(__serviceCode, cls);
                }else{
                    //initilize시 옴니추어 호출로 바뀌면서 기존 gnb 서비스의 클릭시에는 호출안함.
                    omnitureClickName = "";
                }
                
                element.unbind("click");
                element.bind("click", function(e) {
                    if(typeof omnitureClickName != 'undefined' && omnitureClickName != "") {
                        __me.checkAjaxOmnitureCall(omnitureClickName);
                    }
                    
                    if(element.get(0).tagName != 'A'){
                        if(e.ctrlKey == false) {
                            if(targetType == "N"){
                                window.open(linkUrl); 
                            } else {
                                document.location.href = linkUrl;
                            }
                        } else if(e.ctrlKey == true){
                            window.open(linkUrl); 
                        }
                    } 
                });
            },
            
            bindSiteLinkUrl : function(elementO, targetType, linkUrl, omnitureClickName) {
                
                if(elementO.length <= 0) return;
                
                var element= $(elementO);
                
                if(element.get(0).tagName == 'A'){
                    element.attr("href", linkUrl);
                    if(targetType == "N"){
                        element.attr("target", "_blank");
                        //[cnswa2013] 20130816 jjl - 새창 타이틀 속성 생성
                        if (__language == 'ko' ) element.attr("title", getNcomuiMessageBundleValue("v6_web_t0002"));
                    }
                } 
                
                element.unbind("click");
                element.bind("click", function(e) {
                    if(typeof omnitureClickName != "undefined" && omnitureClickName != "") {
                        __me.checkAjaxOmnitureCall(omnitureClickName);
                    }
                    
                    if(element.get(0).tagName != 'A'){
                        if(e.ctrlKey == false) {
                            if(targetType == "N"){
                                window.open(linkUrl); 
                            } else {
                                document.location.href = linkUrl;
                            }
                        } else if(e.ctrlKey == true){
                            window.open(linkUrl); 
                        }
                    } 
                });
            },
            
            bindAccountInfo : function(id){
                var element = $("#" + id + " .ncomui-account > a");                
                if(element.length <= 0) return;
                    
                element.unbind("click");
                element.bind("click", function(e){
                    if(typeof __eventListener == "undefined" || __eventListener == null) return;
                    __me.myProfile(__serviceId);
                    return false;
                });
            },
                        
            bindLogin : function(id) {
                var element = $("#" + id + " .ncomui-sign > a");
                if(element.length <= 0) return;

                element.unbind("click");
                element.bind("click", function(e){
                    if(typeof __eventListener == "undefined" || __eventListener == null) return;
                    if(typeof e == "undefined")
                        e = window.event;

                    var element = e.srcElement? e.srcElement : e.target;
                    var evt = new __clsEvent();

                    if(__userAccount == "")
                        evt.type = __me.event.type.SIGN_IN_CLICKED_EVENT;
                    else
                        evt.type = __me.event.type.SIGN_OUT_CLICKED_EVENT;

                    __eventListener(evt);
                    return false;
                });
            },

            bindAbout : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-aboutus > span > a"), "C", "ncomui-aboutus");
            },

            bindSupport : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-support > a"), "C", "ncomui-support");          
                
            },

            bindNews : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-news > a"), "C", "ncomui-news");
            },

            bindEvent : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-event > a"), "C", "ncomui-event");
            },
            bindUpoint : function(id) {
                __me.bindSiteLinkEx($("#" + id + " .ncomui-upoint > a"), "C", "ncomui-upoint");
            },
            bindSamsung : function(id) {
                var element = $("#" + id + " .ncomui-logo > .sec");
                if(element.length <= 0) return;

                $(element).attr("target", "_blank");
                if(__serverMode == "cn" || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))){
                    $(element).attr("href", "http://www.samsung.com/cn");
                }else if(__country == 'KR'){
                    $(element).attr({href: "http://www.samsung.com/sec", title: "삼성전자 대표 홈페이지 바로가기(새 창)"});
                }else{
                    var linkSec = "http://www.samsung.com/";
                    if(__secPath[__country] != undefined ){
                        if(__secPath[__country][__language.substring(0,2)] != undefined ){                  
                            linkSec += __secPath[__country][__language.substring(0,2)];
                        }
                    }
                    $(element).attr("href", linkSec);
                }
            },
            
            bindSitemap : function(id) {
            
                __me.bindSiteLinkEx($("." + id + " .ncomui-sitemap > a"), "C", "ncomui-sitemap");
            },
            
            bindideaBoard : function(id){
            
                    var element = $("." + id + " .ncomui-ideaboard > a");
                   
                    if(element.length <= 0) return;
                    
                    var bool = false;
                    //[cnswa2013] 20130816 jjl - 새창 타이틀 속성 생성
                    if (__language == 'ko' ) element.attr({title: getNcomuiMessageBundleValue("v6_web_t0002"), target:'blank'});
                    
                    element.unbind("click");
                    element.bind("click", function(e){
                    e.preventDefault();  

                     if(__userAccount == ""){
                        
                        bool = confirm(getNcomuiMessageBundleValue('v6_pc_idea_t0007'));
                        
                        if(bool){                       
                            if(typeof __eventListener == "undefined" || __eventListener == null) return;
                            if(typeof e == "undefined")
                                e = window.event;
        
                            var element = e.srcElement? e.srcElement : e.target;
                            var evt = new __clsEvent();
        
                            if(__userAccount == "")
                                evt.type = __me.event.type.SIGN_IN_CLICKED_EVENT;
                            else
                                evt.type = __me.event.type.SIGN_OUT_CLICKED_EVENT;
        
                            __eventListener(evt);
                            return false;
                         }else{
                         
                         }
                           
                    }else{
                        //var linkUrl = "http://"+__primaryUrl+"/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/idea/ideaBoard.do";     
                        
                        
                        if(__me.getCookie("representationLanguageYn") == "N"){
                            var linkUrl = "http://"+__primaryUrl+"/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/idea/ideaBoard.do";    
                        }else{
                            var linkUrl = "http://"+__primaryUrl+"/" + ncomuiUrlNationCode + "/idea/ideaBoard.do";             
                        }           
                        window.open(linkUrl,'idea','left=0,top=50, location=no, scrollbars=no,width=507,height=560,resizable=no');
                    }                       
                 });
             
            },
    
            //[cnswa2013] 20130816 jjl - 풋터링크 셀렉터 수정(span->a)
            bindTerms : function(id) {
                var element = $("." + id + " .ncomui-terms-conditions > a");
                if(element.length <= 0) return;
                
                var saParamLocale = __me.saParamCheck();

                var linkUrl = "https://account.samsung.com/membership/terms?paramLocale=" + saParamLocale;
                __me.bindSiteLinkUrl(element, "N", linkUrl, __me.getOmnitureClickName(__serviceCode,"terms"));
            },

            bindPrivacy : function(id) {
                var element = $("." + id + " .ncomui-privacy > a");
                if(__serviceCode == 'apps' && __country == "KR" && __serverMode != "cn"){
                    element.addClass("text");
                }
                if(element.length <= 0) return;
                
                var saParamLocale = __me.saParamCheck();
                
                var linkUrl = "https://account.samsung.com/membership/pp?paramLocale=" + saParamLocale;
                __me.bindSiteLinkUrl(element, "N", linkUrl, __me.getOmnitureClickName(__serviceCode,"pp"));

            },
            
            bindPrivacyHandle : function(id,e) {
                
                var element = $("." + id + " .ncomui-privacy-handle > a");
                if(__serviceCode == 'apps' && __country == "KR" && __serverMode != "cn"){
                    element.addClass("text");
                }
                if(element.length <= 0) return;
                
                var linkUrl = "https://account.samsung.com/membership/pdp?paramLocale=ko_KR";
                __me.bindSiteLinkUrl(element, "N", linkUrl, __me.getOmnitureClickName(__serviceCode,"pdp"));

                if ( __country != "KR" && __country != "kr" || __language != 'ko' ) {
                    $("." + id + " .ncomui-privacy-handle").hide();
                }
            },
            
            bindYouthPolicy : function(id) {
                var element = $("." + id + " .ncomui-youth-policy > a");
                
                if(element.length <= 0) return;
                
                var linkUrl = "http://apps.samsung.com/mercury/common/youthPolicy.as";
                __me.bindSiteLinkUrl(element, "N", linkUrl);
              },
            
            bindWebsiteCredits : function(id) {
                var element = $("." + id + " .ncomui-website-credits > a");
                if(element.length <= 0) return;

                if(__me.getCookie("representationLanguageYn") == "N"){
                    var linkUrl = "http://"+__primaryUrl+"/" + ncomuiUrlNationCode + "/" + __language.substring(0,2) + "/common/getWebsiteCredits.do";    
                }else{
                    var linkUrl = "http://"+__primaryUrl+"/" + ncomuiUrlNationCode + "/common/getWebsiteCredits.do";             
                }
                
                __me.bindSiteLinkUrl(element, "C", linkUrl);
            },

            bindPrivacyCollect : function(id) {
                var element = $("." + id + " .ncomui-privacy-collect > a");
                if(element.length <= 0) return;
                
                var linkUrl = "https://account.samsung.com/membership/pdu?paramLocale=ko_KR";
                __me.bindSiteLinkUrl(element, "N", linkUrl, __me.getOmnitureClickName(__serviceCode,"pdu"));
                
                if ( __country != "KR" && __country != "kr"  || __language != 'ko' ) {
                    $("." + id + " .ncomui-privacy-collect").hide();
                }
            },

            bindSocialN : function(id) {
                __me.bindSiteLinkEx($("." + id + " .ncomui-social-n > a"), "C", "ncomui-social-n");
            },

            bindFacebook : function(id) {
                var element = $("." + id + " .ncomui-facebook > a");
                if(element.length <= 0) {
                    return;
                }
                
                var linkUrl = "http://www.facebook.com/samsungnservice";
                __me.bindSiteLinkUrl(element, "N", linkUrl);
                
            },

            bindTwitter : function(id) {
                var element = $("." + id + " .ncomui-twitter > a");
                if(element.length <= 0) {
                    return;
                }
                
                var linkUrl = "https://twitter.com/#!/SamsungNTweet";
                __me.bindSiteLinkUrl(element, "N", linkUrl);
      
            },            
            //풋터링크 셀렉터 수정  
            
            setCookie : function (cookie_key, cookie_value, exdays)
            {
                var expire = new Date();
                expire.setDate(expire.getDate() + exdays);
                var cookies = cookie_key + '=' + escape(cookie_value) + '; path=/; domain=' + __primaryDomain; // 한글 깨짐을 막기위해 escape(cValue)를 합니다.
                if(typeof exdays != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';';
                document.cookie = cookies;
            },

            getCookie : function (cookie_name)
            {
                var i, key, value, cookies = document.cookie.split(";");
                for(i = 0; i < cookies.length; i++) {
                    key = cookies[i].substr(0, cookies[i].indexOf("="));
                    value = cookies[i].substr(cookies[i].indexOf("=") + 1);
                    key = key.replace(/^\s+|\s+$/g,"");
                    if(key == cookie_name && value != '""') {
                        return unescape(value);
                    }
                }
                return "";
            },
            
            getEmailAddress : function() {
                return __userAccount;
            },
            
            getCountry : function() {
                return __country;
            },
            
            getLanguage : function() {
                return __language;
            },
            
            getServiceCode : function() {
                return __serviceCode;
            },

            getCountryText : function() {
                return __countryCodesEnglish[__country];
            },
            
            getLanguageText : function() {
                return __languageCodesLocale[__language];
            },

            printCountry : function(country) {
                document.write(__countryCodesEnglish[country]);
            },
            
            printLanguage : function(language) {
                document.write(__languageCodesLocale[language]);
            },

            printLocale : function(country, language) {
                document.write(__countryCodesEnglish[country] + " / " + __languageCodesLocale[__language]);
            },
            
            getOmnitureClickName : function(serviceCode, service) {
                var omnitureClickName;
                
                try {
                    omnitureClickName = __linkOmniture[serviceCode][service];
                } catch(e) {
                    omnitureClickName = "";
                }
                
                if(typeof omnitureClickName == "undefined" || omnitureClickName == ""){
                    try {
                        omnitureClickName = __linkOmniture["ncom"][service];
                    } catch(e) {
                        omnitureClickName = "";
                    }
                    
                }
                
                if(typeof omnitureClickName == "undefined"){
                    omnitureClickName = "";
                }
                
                omnitureClickName = omnitureClickName.replace("__COUNTRY_CODE__", __country.toLowerCase());
                
                return omnitureClickName;
            },
            
            checkAjaxOmnitureCall : function(clickName) {
                try{
                    if(typeof clickName != 'undefined' && clickName != ""){
                        
                        var clickNames = clickName.split("|");
                        
                        if(clickNames[0] == "A"){
                            
                            var omniServiceCode = __serviceCode;
                            if(omniServiceCode == "ncom") omniServiceCode = "cnsportal";
                            
                            ncomui_ajax_omnitureCall(clickNames[1], omniServiceCode);
                        } else {
                            ncomui_trackClicks(clickNames[1]);
                        }
                    }
                } catch(e) {}
            },
            
            omnitureImport : function(pageName) {
                if(typeof pageName == 'undefined'){
                    pageName = 'kr:pc:main:nfx:main';
                }
                
                  var html = new Array();
                  html.push('<script type="text/javascript">      ');
                  
                  if(__userAccount != "") {
                      html.push('    s_ncomui.eVar7="logged in";                                  ');
                  }
                  else {
                      html.push('    s_ncomui.eVar7="logged out";                                  ');
                  }
                  
                  html.push('    function ncomui_ajax_omnitureCall(clickName, serviceName) {                ');
                  html.push('        ncomui_eventsValueInit();                                 ');
                  html.push('        s_ncomui.hier1=clickName;                                 ');
                  html.push('        s_ncomui.pageName=clickName;                              ');
                  html.push('        s_ncomui.eVar9 = serviceName;                              ');
                  html.push('        void(s_ncomui.t());                                       ');
                  html.push('        return false;   ');
                  html.push('    }                                                      ');
                  
                  html.push('    function ncomui_eventsValueInit() {                           ');
                  html.push('        s_ncomui.eVar5="";                           ');
                  html.push('        s_ncomui.eVar8="";                           ');
                  html.push('        s_ncomui.events="";                           ');
                  html.push('    }                           ');
                  
                  html.push('   function ncomui_trackClicks(ClickName) {        ');
                  html.push('        s_ncomui.linkTrackVars="eVar5,events,hier2";       ');
                  html.push('        s_ncomui.linkTrackEvents="event5";                 ');
                  html.push('        s_ncomui.eVar5=ClickName;                          ');
                  html.push('        s_ncomui.events="event5";                          ');
                  html.push('        if(s_ncomui.eVar5&&!s_ncomui.hier2) s_ncomui.hier2=s_ncomui.eVar5;     ');
                  html.push('        s_ncomui.tl(true,"o","Internal Clicks");           ');
                  html.push('   }                                             ');


                  html.push('   function goSupport() {');
                  html.push('       var frm = document.goSupportFrom;');
                  html.push('       frm.submit();');
                  html.push('   }                                             ');
                  
//                  if(__serviceCode != 'ncom'){
//                      html.push('    /* Omniture Tracking Start */ ');
//                      //html.push('    s_ncomui.pageName = "'+__country.toLowerCase()+':pc:main:nfx:main"; ');
//                      //html.push('    if(!s_ncomui.campaign) s_ncomui.campaign=s_ncomui.getQueryParam("cid"); ');
//                      html.push('    var s_code=s_ncomui.t(); ');
//                      html.push('    if(s_code)document.write(s_code); ');
//                      html.push('    /* Omniture Tracking End */  ');
//                  }
                  
                  html.push('</script> ');
                  $('body').append(html.join(""));
                  
            },
            
            omnitureOnloadCall : function() {
                //페이지 로드시 옴니추어 호출
                var omnitureClickName = __me.getOmnitureClickName(__serviceCode, __serviceCode);
                
                if(typeof omnitureClickName != 'undefined' && omnitureClickName != "") {                        
                    __me.checkAjaxOmnitureCall(omnitureClickName);
                }
            },
            
            ncomuiLoadingScript : function(url){
                var script = document.createElement("script")
                script.setAttribute('type','text/javascript');

                if (script.readyState){  //IE
                    script.onreadystatechange = function(){                 
                        if (script.readyState == "loaded" ||
                                script.readyState == "complete"){
                            script.onreadystatechange = null;
                        }
                    };
                } 
                
                script.setAttribute('src',url);
                document.getElementsByTagName("body")[0].appendChild(script);
            },
            
            ncomuiLoadScript : function(url, callback){
                if(typeof s_ncomui != 'object'){
                    var script = document.createElement("script")
                    script.setAttribute('type','text/javascript');

                    if (script.readyState){  //IE
                        script.onreadystatechange = function(){                 
                            if (script.readyState == "loaded" ||
                                    script.readyState == "complete"){
                                script.onreadystatechange = null;

                               callback();
                            }
                        };
                    } else {  //Others
                        script.onload = function(){
                            callback();
                        };
                    }
                    script.setAttribute('src',url);
                    document.getElementsByTagName("body")[0].appendChild(script);
                } else {
                    callback();
                }
            },
            
            ncomuiOpenPop : function(theURL, winName, w, h, scroll, location) {
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                var sc = "no";
                var loc = "yes";

                if (scroll == "yes") {
                    sc = "yes";
                }
                
                if (location == "no") {
                    loc = "no";
                }    

                window.open(theURL, winName, "width=" + w + ", height=" + h + ", left=" + winl + ", top="
                        + wint + ", scrollbars=" + sc + ", location=" + loc);
            },
            
            saParamCheck : function() {
                var saParamLocale= "";
                
                try{
                    saParamLocale = __samsungAccountParamLocale[__country][__language.substring(0, 2)];
                    if(typeof __samsungAccountParamLocale[__country][__language.substring(0, 2)] == "undefined"){
                        saParamLocale = __samsungAccountParamLocale[__country][__country];
                        if(typeof saParamLocale == "undefined"){
                            saParamLocale = "en_GB";
                        }
                    }
                }
                catch(e) {
                    saParamLocale = "en_GB";
                }
            
                return saParamLocale;
            },
            
            myProfile : function(serviceId){
                if(typeof serviceId == "undefined"){
                    serviceId = "ts3rap101s";
                }
                var birthdate = "";
                var pp_name = "";
                var pp_birth = "";
                var pp_country = "";
                var nationality = "";
                var iPlanetDirectoryPro = __me.getCookie("iPlanetDirectoryPro");
                $.ajax({
                    url: window.location.protocol + "//" + __primaryUrl + "/svc/ajax/member/myprofile/getMemberProfileAjaxJson",
                    data : { iPlanetDirectoryPro : iPlanetDirectoryPro, serviceId : serviceId },
                    dataType: "jsonp",
                    jsonp : "callback", 
                    success: function(data) {
                        if( data != null){
                    
                            nationality = data["nationality"];
                            __me.nationName(nationality);
                            
                            birthdate = data["birthDate"];
                            if(__serverMode == "cn" || __country == "KR" || __country == "CN" || __country == "JP" || __country == "TH" || __country == "VN" || __country == "HU"){
                                if(__country == "KR"){
                                    pp_name = "<strong>"+data["lastName"]+data["firstName"]+"</strong>";
                                }else{
                                    pp_name = "<strong>"+data["lastName"]+" "+data["firstName"]+"</strong>";
                                }
                            }else{
                                pp_name = "<strong>"+data["firstName"]+" "+data["lastName"]+"</strong>";
                            }
                            
                            if(__country == "RU"){
                                pp_birth = "<strong>"+ getNcomuiMessageBundleValue('v6_pc_profile_t0001') +"</strong>"+birthdate.toString().substring(6,8)+"."+birthdate.toString().substring(4,6)+"."+birthdate.toString().substring(0,4);
                            }else{
                                pp_birth = "<strong>"+ getNcomuiMessageBundleValue('v6_pc_profile_t0001') +"</strong>"+birthdate.toString().substring(0,4)+"."+birthdate.toString().substring(4,6)+"."+birthdate.toString().substring(6,8);
                            }
                            
                            $('.pp-name').html(pp_name);
                            
                           if((__serverMode == "cn" || __country == "IN" || __country == "KR") || (__country == "CN" && (__serviceCode == "chaton" || __serviceCode == "support" || __serviceCode == "support2"))){
                                if(data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != ''){
                                        $('.pp-phone').remove();
                                        $('.pp-name').after('<p class="pp-phone"><span>'+data["phoneID"]+'</span></p>');
                                }
                                if(data["emailID"] != 'undefined' && data["emailID"] != null && data["emailID"] != ''){
                                        $('.pp-mail').remove();
                                        $('.pp-name').after('<p class="pp-mail"><span>'+data["emailID"]+'</span></p>');  
                                }
                                if((data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != '') && (data["emailID"] != 'undefined' && data["emailID"] != null && data["emailID"] != '')){
                                    $('#SSProfilePop').removeClass("all_info");
                                    $('#SSProfilePop').removeClass("all_phone");
                                    $('#SSProfilePop').addClass("all_info");
                                }else if(data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != ''){
                                    $('#SSProfilePop').removeClass("all_phone");
                                    $('#SSProfilePop').addClass("all_phone");
                                }
                                
                            }else{
                                
                                if(data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != ''){
                                        $('.pp-phone').remove();
                                        $('.pp-name').after('<p class="pp-phone"><span>'+data["phoneID"]+'</span></p>');
                                }
                                if(data["emailID"] != 'undefined' && data["emailID"] != null && data["emailID"] != ''){
                                        $('.pp-mail').remove();
                                        $('.pp-name').after('<p class="pp-mail"><span>'+data["emailID"]+'</span></p>');  
                                }
                                if((data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != '') && (data["emailID"] != 'undefined' && data["emailID"] != null && data["emailID"] != '')){
                                    $('#SSProfilePop').removeClass("all_info");
                                    $('#SSProfilePop').removeClass("all_phone");
                                    $('#SSProfilePop').addClass("all_info");
                                }else if(data["phoneID"]!= 'undefined' && data["phoneID"] != null && data["phoneID"] != ''){
                                    $('#SSProfilePop').removeClass("all_phone");
                                    $('#SSProfilePop').addClass("all_phone");
                                }
                            }
                            
                            //$('.pp-mail').find('span').html(data["emailID"]);
                            $('.pp-birth').html(pp_birth);
                            
                            $('#SSProfilePop').fadeIn('fast');
                            $('#pop-profile-close').one('click',function(){$('#SSProfilePop').fadeOut('fast', function(){ $('#SSProfilePop').prev().focus();}); });
                        
                            __me.myProfileImg(data["gUID"]);
                        }
                    }
                });
            },
            
            myProfileImg : function(guid) {
                var iPlanetDirectoryPro = __me.getCookie("iPlanetDirectoryPro");
                var noImg = '/static/ncomui/assets/tmp/thumb_top_d.jpg';
                $.ajax({
                    url: window.location.protocol + "//" + __primaryUrl + "/svc/ajax/gateway/chaton/getChatOnMyProfileImageJsonp",
                    data : { guid : guid, iPlanetDirectoryPro : iPlanetDirectoryPro, size : "100" },
                    dataType: "jsonp",
                    jsonp : "callback", 
                    success: function(response) {
                        try{
                            if( typeof response == 'undefined'){
                            
                            } else {
                                var chatOnProfileInfo = response[1];
                                if(chatOnProfileInfo["status"] == 400){
                                    $('.floatl').find('img').attr("src", __primaryStaticCommonUrl + noImg);
                                }
                                else{
                                    if(chatOnProfileInfo["img_status"] == 1) {
                                        var timeStamp = Math.ceil(Math.random() * 10000000000);                                    
                                        $('.floatl').find('img').attr("src", response[0]["chaton_id"]+"&r="+timeStamp);
                                        if(__country == "KR"){                                    
                                            $('.floatl').find('img').attr("alt", $('.profile-wrap .pp-name strong').text() +" "+getNcomuiMessageBundleValue('v6_web_t0015'));
                                        }else{
                                            $('.floatl').find('img').attr("alt", $('.profile-wrap .pp-name strong').text());
                                        }
                                    }else{
                                        $('.floatl').find('img').attr("src", __primaryStaticCommonUrl + noImg);
                                    }
                                }
                            }
                        } catch(e){
                            $('.floatl').find('img').attr("src", __primaryStaticCommonUrl + noImg);
                        }
                    }
                });
                var element = $("#SSProfilePop .floatl > a");                
                if(element.length <= 0) return;
                element.unbind("click");
                element.bind("click", function(e){
                    if(typeof e == "undefined")
                        e = window.event;

                    var element = e.srcElement? e.srcElement : e.target;
                    var evt = new __clsEvent();

                    if(__userAccount == "")
                        evt.type = __me.event.type.ACCOUNT_CLICKED_EVENT;
                    else
                        evt.type = __me.event.type.ACCOUNT_CLICKED_EVENT;

                    __eventListener(evt);
                    
                    return false;
                });
            },
            
            nationName : function(nationality) {
                $.ajax({
                    url: window.location.protocol + "//" + __primaryUrl + "/svc/ajax/member/myprofile/getNationNameJson",
                    data : { thirdNationCode : nationality },
                    dataType: "jsonp",
                    jsonp : "callback", 
                    success: function(response) {
                        pp_country = "<strong>"+ getNcomuiMessageBundleValue('v6_pc_profile_t0002') +"</strong>"+response["nationName"];
                        $('.pp-country').html(pp_country);
                    }
                });
            },
            
            base64enco : function(InStr){
              var ttb = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
              var len_1 = InStr.length;
              var len_res = InStr.length % 3;
              var len_div = len_1 - len_res;
              var ra = new __me.makeArray(4);
              var i=0;
              var Stat = "";
        
              var str="";
              while(1)
              {
                if( i >= len_1 )
                     break;
        
        
                if( i >= len_div )
                     Stat = "End"; 
        
                A = eval(InStr.charCodeAt(i++));
                B = eval(InStr.charCodeAt(i++));
                C = eval(InStr.charCodeAt(i++));
        
                if( i > len_div )
                {
                    Stat = "End"; 
        
                    if( len_res >= 1)
                      C = 0;
                    if( len_res == 1 )
                      B = 0;
                }
                ra[1] = A >> 2;
                ra[2] = ( (A & 3) << 4 ) + (B >> 4);
                ra[3] = ( ( B & 15 ) << 2 ) + ( C >> 6);
                ra[4] = C & 63;
        
                if( Stat == "End" && len_res >= 1 )
                      ra[4] = 64;
                if( Stat == "End" && len_res == 1 )
                      ra[3] = 64;
        
                for(k=1;k<=4;k++)
                   str = str + ttb.substr(ra[k],1);
             } 
             return str;
            },

            makeArray : function(n){
                this.length=n
                for(var i=1; i<=n; i++){
                        this[i]=null;
                }
                return this;
            },
            
            goMobileConfirm : function(service) {
                if(confirm(getNcomuiMessageBundleValue("pc_msg_C0401_t0003"))){
                    __me.setCookie('_full_browser', 'N', 1);
                    document.location.href = __mobileLinkUrl[__mode][service].replace(new RegExp("&_full_browser=Y", "gi"), "");
                }else{
                    if(service == "chaton"){
                        document.location.href = __mobileLinkUrl[__mode][service];
                    }else{
                        document.location.href = __linkUrl[__mode][service];
                    }
                }
            }
            
        };
        return __ncomui;
    })();

    window.ncomui = ncomui;
})();